/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    color: #333;
    overflow: hidden;
}

#app {
    height: 100%;
    position: relative;
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    overflow: hidden;
}

.page {
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.hidden {
    display: none !important;
}

/* ===== 登录注册页面 ===== */
.auth-page {
    background: linear-gradient(180deg, #7EC850 0%, #A8E063 50%, #56AB2F 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 360px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo-cow {
    font-size: 80px;
    margin-bottom: 10px;
    animation: bounce 2s ease-in-out infinite;
}

.logo-cow img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.2));
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.auth-logo h1 {
    font-size: 32px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    margin-bottom: 5px;
}

.auth-logo p {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    background: rgba(255,255,255,0.2);
    border-radius: 25px;
    padding: 4px;
    margin-bottom: 25px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    color: rgba(255,255,255,0.8);
    font-size: 15px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-tab.active {
    background: #fff;
    color: #56AB2F;
    font-weight: 600;
}

.auth-forms {
    background: #fff;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.form-group input {
    width: 100%;
    height: 48px;
    padding: 0 15px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #7EC850;
}

.btn-primary {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #7EC850, #56AB2F);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-small {
    padding: 6px 14px;
    border: none;
    border-radius: 15px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
}

.btn-sell {
    background: #FFF3E0;
    color: #FF9800;
}

.btn-buy {
    background: #E8F5E9;
    color: #4CAF50;
}

.btn-edit {
    padding: 5px 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 15px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    margin-top: 5px;
}

/* ===== 主页面布局 ===== */
.main-page {
    display: flex;
    flex-direction: column;
    background: #f5f7fa;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, #7EC850, #56AB2F);
    color: #fff;
    flex-shrink: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-bar-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.top-bar-milk {
    font-size: 14px;
    color: #fff;
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pasture-locked {
    overflow: hidden !important;
    max-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
}

.pasture-locked .pasture-scene {
    flex: 1 1 auto !important;
    aspect-ratio: auto !important;
    max-height: none !important;
    min-height: 200px !important;
}

.pasture-content-fixed {
    flex-shrink: 0 !important;
    padding-bottom: 10px !important;
}

.coin-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 15px;
}

.coin-icon {
    font-size: 16px;
}

.coin-label {
    font-size: 12px;
    opacity: 0.9;
}

.avatar-small {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: #fff;
}

.content-area.is-home {
    background: #7EC850;
}

.content-page {
    display: none;
    min-height: 100%;
}

.content-page.active {
    display: block;
    animation: pageFadeIn 0.15s ease-out;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.page-header {
    padding: 20px 15px 10px;
}

.page-header h2 {
    font-size: 22px;
    margin-bottom: 4px;
    color: #333;
}

.page-header p {
    font-size: 13px;
    color: #999;
}

/* ===== 底部导航 ===== */
.bottom-nav {
    display: flex;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    flex-shrink: 0;
}

.nav-item {
    flex: 1;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-item.active .nav-text {
    color: #56AB2F;
    font-weight: 600;
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 2px;
    transition: transform 0.2s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
}

.nav-cow-icon {
    width: auto;
    height: 32px;
    object-fit: contain;
    vertical-align: middle;
    max-width: 100%;
}

.nav-text {
    font-size: 11px;
    color: #999;
}

/* ===== 首页牧场 ===== */
.pasture-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* 首页牧场页面透明，只显示牧场背景 */
#page-home {
    height: 100%;
    background: #7EC850;
}

.pasture-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../assets/images/pasture_bg.png') center/cover no-repeat;
    z-index: 0;
}

/* 牧场视频背景 */
.pasture-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 1;
    pointer-events: none;
    opacity: 1;
    background: transparent;
}

.pasture-bg-video.video-ready {
    opacity: 1;
}

/* 隐藏WebView默认视频播放按钮 */
.pasture-bg-video::-webkit-media-controls-play-button,
.pasture-bg-video::-webkit-media-controls-start-playback-button,
.pasture-bg-video::-webkit-media-controls {
    display: none !important;
    -webkit-appearance: none !important;
}

.pasture-cows-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.pasture-cow-item {
    position: absolute;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.2s;
}

.pasture-cow-item:active {
    transform: scale(0.95);
}

.pasture-cow-visual {
    position: relative;
}

/* 奶牛序列帧 - 由JS控制帧切换 */
.pasture-cow-sprite {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
}

/* ===== 方案三：CSS模拟咀嚼动画 ===== */
/* 身体完全不动，只让嘴巴区域通过透明度过渡模拟张合 */

/* 基础层：闭嘴的牛（第1帧），完全静止 */
.pasture-cow-item.css-mode .pasture-cow-sprite {
    background-image: url('../assets/images/cow_eat_01.png') !important;
}

/* 嘴巴遮罩层：只显示张嘴帧的嘴巴区域，通过透明度动画模拟咀嚼 */
.pasture-cow-mouth {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    /* 裁剪出嘴巴区域：右侧偏下位置 */
    clip-path: inset(58% 8% 20% 62%);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}

.pasture-cow-item.css-mode.eating .pasture-cow-mouth {
    animation: mouthChew 5s ease-in-out infinite;
}

@keyframes mouthChew {
    0%, 100% { opacity: 0; }       /* 闭嘴 */
    25% { opacity: 0.5; }          /* 半张 */
    50% { opacity: 1; }            /* 全张 */
    75% { opacity: 0.4; }          /* 半合 */
}

/* 小草也跟着微微上下动 */
.pasture-cow-item.css-mode.eating .pasture-cow-grass {
    animation: grassBob 5s ease-in-out infinite;
}

@keyframes grassBob {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.9; }
    25% { transform: translateX(-50%) translateY(1px); opacity: 1; }
    50% { transform: translateX(-50%) translateY(0); opacity: 0.9; }
    75% { transform: translateX(-50%) translateY(1.5px); opacity: 1; }
}

/* ===== 方案四：视频模式 ===== */
.pasture-cow-item.video-mode .pasture-cow-sprite {
    display: none;
}

.pasture-cow-item.video-mode .pasture-cow-mouth {
    display: none;
}

.pasture-cow-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    pointer-events: none;
    /* 白色背景用正片叠底融入牧场 */
    mix-blend-mode: multiply;
}

/* 奶牛底部阴影 */
.pasture-cow-shadow {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 65%;
    height: 10px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.08) 50%, transparent 75%);
    border-radius: 50%;
    z-index: -1;
}

/* 小草被啃食特效 - 4帧序列 */
.pasture-cow-grass {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    opacity: 0;
    pointer-events: none;
}

.pasture-cow-item.eating .pasture-cow-grass {
    opacity: 1;
}

/* 静止状态：显示第1帧 */
.pasture-cow-item:not(.eating) .pasture-cow-sprite {
    background-image: url('../assets/images/cow_eat_01.png');
}

.pasture-cow-bubble {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.95);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-weight: 500;
    z-index: 3;
}

.pasture-cow-bubble.hungry {
    color: #FF9800;
}

.pasture-cow-bubble.hungry::before {
    content: '😋 饿了';
}

.pasture-cow-bubble.ready {
    color: #4CAF50;
}

.pasture-cow-bubble.ready::before {
    content: '🥛 可挤奶';
}

.pasture-cow-bubble.fed {
    color: #2196F3;
}

.pasture-cow-bubble.fed::before {
    content: '🍼 吃草中';
}

.pasture-cow-name {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
    white-space: nowrap;
    font-weight: 500;
}

/* 首页牧场操作按钮 */
.pasture-actions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 20px;
    background: rgba(255,255,255,0.95);
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: transform 0.2s;
}

.action-btn:active {
    transform: scale(0.95);
}

.action-icon {
    font-size: 28px;
}

.feed-btn .action-icon {
    animation: wiggle 2s ease-in-out infinite;
}

.deliver-btn {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: #fff;
    padding: 14px 28px;
    font-weight: 600;
    font-size: 15px;
}

.deliver-btn:active {
    transform: scale(0.95);
}

.deliver-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.delivery-countdown {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 10;
    white-space: nowrap;
}

/* ===== 配送饲料视频弹窗 ===== */
.delivery-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delivery-video-modal.hidden {
    display: none;
}

.delivery-video-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    padding: 20px;
    text-align: center;
}

.delivery-video-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    z-index: 2;
    display: none;
}

.delivery-video-player {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 12px;
    background: #1a1a2e;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.delivery-video-player.video-ready {
    opacity: 1;
}

.delivery-video-title {
    margin-top: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.delivery-video-progress {
    margin-top: 15px;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.delivery-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #FF9800, #FFB74D);
    transition: width 0.3s linear;
    border-radius: 3px;
}

.cow-count-info {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.9);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    color: #666;
    z-index: 10;
}

.cow-count-info b {
    color: #56AB2F;
}

/* 动画模式切换 */
.anim-mode-switch {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.anim-mode-btn {
    padding: 8px 12px;
    background: rgba(255,255,255,0.9);
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    line-height: 1.3;
    text-align: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.anim-mode-btn small {
    font-size: 10px;
    color: #999;
}

.anim-mode-btn.active {
    background: rgba(86, 171, 47, 0.95);
    color: #fff;
    border-color: #7EC850;
}

.anim-mode-btn.active small {
    color: rgba(255,255,255,0.85);
}

.anim-mode-btn:active {
    transform: scale(0.95);
}

/* ===== 牛市页面（2x2网格） ===== */
.market-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 15px 130px;
}

.market-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.market-card-img {
    width: 100%;
    aspect-ratio: 1;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f9f9f9;
}

.market-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    padding: 8px 10px 2px;
}

.market-card-desc {
    font-size: 11px;
    color: #999;
    padding: 0 10px 4px;
}

.market-card-price {
    font-size: 16px;
    font-weight: 700;
    color: #FF9800;
    padding: 0 10px 8px;
}

.market-card-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 6px 10px 10px;
    border-top: 1px solid #f5f5f5;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #f0f0f0;
    font-size: 18px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.qty-btn:active {
    background: #e0e0e0;
    transform: scale(0.92);
}

.qty-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    min-width: 24px;
    text-align: center;
}

/* 底部结算栏 */
.market-checkout-bar {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 10px 15px;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 100;
}

.checkout-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.checkout-count {
    font-size: 12px;
    color: #999;
}

.checkout-total {
    font-size: 16px;
    font-weight: 700;
    color: #FF9800;
}

.checkout-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #7EC850, #56AB2F);
    color: #fff;
    border: none;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.checkout-btn:active {
    transform: scale(0.95);
}

/* ===== 奶牛页面 ===== */
/* ===== 牛舍页面 ===== */
.cowshed-header {
    padding: 20px 16px 12px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: #fff;
    border-radius: 0 0 20px 20px;
    margin-bottom: 15px;
}

.cowshed-title h2 {
    font-size: 22px;
    margin: 0 0 6px 0;
}

.cowshed-count {
    font-size: 14px;
    opacity: 0.9;
}

.cowshed-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 0 12px 20px;
}

.cowshed-cell {
    background: linear-gradient(145deg, #FFF8DC, #F5DEB3);
    border: 2px solid #DEB887;
    border-radius: 12px;
    aspect-ratio: 1 / 1.15;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px 8px;
    position: relative;
    box-shadow: 0 2px 6px rgba(139, 69, 19, 0.15);
}

.cowshed-cell.cow-cell {
    cursor: pointer;
    transition: transform 0.2s;
}

.cowshed-cell.cow-cell:active {
    transform: scale(0.95);
}

.cowshed-cell.empty-cell {
    background: rgba(255, 248, 220, 0.3);
    border: 2px dashed #DEB887;
    opacity: 0.5;
}

.cowshed-cow-img {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
}

.cowshed-cow-anim {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
}

.cowshed-cow-video-wrap {
    position: relative;
    width: 90%;
    height: 65%;
    margin-top: 4px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.cowshed-cow-bgimg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/cowshed_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.cowshed-cow-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cowshed-cow-video.video-ready {
    opacity: 1;
}

.cowshed-cow-name {
    font-size: 12px;
    font-weight: bold;
    color: #8B4513;
    margin-top: 2px;
}

.cowshed-cow-countdown {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 3px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(255, 152, 0, 0.3);
}

.cowshed-cow-status {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 6px;
    color: #fff;
}

.cowshed-cow-status.status-hungry {
    background: #FF6B6B;
}

.cowshed-cow-status.status-fed {
    background: #4ECDC4;
}

.cowshed-cow-status.status-ready {
    background: #FFD93D;
    color: #8B4513;
}

.cows-list {
    padding: 0 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cow-card {
    background: #fff;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.cow-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.cow-card-img {
    width: 60px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.cow-card-info {
    flex: 1;
}

.cow-card-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.cow-card-type {
    font-size: 12px;
    color: #999;
}

.cow-card-status {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 10px;
}

.status-hungry {
    background: #FFF3E0;
    color: #FF9800;
}

.status-fed {
    background: #E3F2FD;
    color: #2196F3;
}

.status-ready {
    background: #E8F5E9;
    color: #4CAF50;
}

.cow-card-progress {
    margin-bottom: 12px;
}

.progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7EC850, #56AB2F);
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-label {
    font-size: 11px;
    color: #999;
    display: flex;
    justify-content: space-between;
}

.cow-card-actions {
    display: flex;
    gap: 10px;
}

.cow-action-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
}

.cow-feed-btn {
    background: #FFF3E0;
    color: #FF9800;
}

.cow-milk-btn {
    background: #E8F5E9;
    color: #4CAF50;
}

.cow-action-btn:disabled {
    background: #f0f0f0;
    color: #ccc;
    cursor: not-allowed;
}

.empty-tip {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-tip.small {
    padding: 30px 20px;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-tip p {
    margin-bottom: 15px;
    font-size: 14px;
}

.empty-tip .btn-primary {
    width: auto;
    padding: 8px 24px;
    height: auto;
    font-size: 14px;
}

/* ===== 仓库页面 ===== */
.warehouse-grid {
    padding: 0 15px 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.warehouse-item {
    background: #fff;
    border-radius: 15px;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.wh-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.wh-name {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.wh-count {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.warehouse-records {
    padding: 0 15px 20px;
}

.warehouse-records h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
}

.records-list {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f5f5f5;
}

.record-item:last-child {
    border-bottom: none;
}

.record-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.record-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.record-icon-img {
    width: 24px;
    height: 24px;
    display: block;
}

.record-info {
    font-size: 13px;
}

.record-title {
    color: #333;
    margin-bottom: 2px;
}

.record-time {
    font-size: 11px;
    color: #999;
}

.record-amount {
    font-weight: 600;
    font-size: 14px;
}

.record-amount.plus {
    color: #4CAF50;
}

.record-amount.minus {
    color: #f44336;
}

/* ===== 我的页面 ===== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px 20px;
    background: linear-gradient(135deg, #7EC850, #56AB2F);
    color: #fff;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
}

.profile-phone {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

/* 资产卡片 */
.profile-assets {
    display: flex;
    gap: 12px;
    margin: 15px;
}

.profile-asset-card {
    flex: 1;
    background: #fff;
    border-radius: 15px;
    padding: 16px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.profile-asset-card.clickable:active {
    transform: scale(0.96);
}

.profile-transfer-btn {
    padding: 5px 14px;
    border: none;
    border-radius: 14px;
    background: #f0f0f0;
    font-size: 12px;
    font-weight: 600;
    color: #56AB2F;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.profile-transfer-btn:active {
    transform: scale(0.92);
    background: #e0e0e0;
}

.profile-asset-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.asset-icon-coin {
    background-image: url('../assets/images/icon_coin.png');
}

.asset-icon-seed {
    background-image: url('../assets/images/icon_seed.png');
}

/* 内联小图标（用于价格、数量等文字旁） */
.inline-icon {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
    display: inline-block;
}

.profile-asset-info {
    flex: 1;
    min-width: 0;
}

.profile-asset-value {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.profile-asset-label {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* 分区标题 */
.profile-section {
    margin: 0 15px 12px;
}

.profile-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    padding-left: 2px;
}

/* 支出统计 */
.profile-expense-grid {
    display: flex;
    gap: 12px;
}

.profile-expense-card {
    flex: 1;
    background: #fff;
    border-radius: 15px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.profile-expense-card.clickable:active {
    transform: scale(0.96);
}

.profile-expense-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.profile-expense-amount {
    font-size: 18px;
    font-weight: 700;
    color: #FF9800;
    margin-bottom: 2px;
}

.profile-expense-amount::after {
    content: '';
    display: inline-block;
    width: 13px;
    height: 13px;
    background: url('../assets/images/icon_coin.png') no-repeat center;
    background-size: contain;
    margin-left: 2px;
    vertical-align: -1px;
}

.profile-expense-label {
    font-size: 12px;
    color: #999;
}

/* 牛币收入 */
.profile-income-grid {
    display: flex;
    gap: 10px;
}

.profile-income-card {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.profile-income-card.highlight {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    box-shadow: 0 2px 12px rgba(76, 175, 80, 0.15);
}

.profile-income-label {
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
}

.profile-income-card.highlight .profile-income-label {
    color: #4CAF50;
    font-weight: 600;
}

.profile-income-amount {
    font-size: 17px;
    font-weight: 700;
    color: #4CAF50;
}

.profile-income-amount::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background: url('../assets/images/icon_coin.png') no-repeat center;
    background-size: contain;
    margin-left: 2px;
    vertical-align: -1px;
}

/* 奶牛数量 */
.profile-cow-count {
    margin: 0 15px 12px;
    background: #fff;
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.profile-cow-count b {
    color: #56AB2F;
    font-size: 18px;
}

.profile-cow-icon {
    font-size: 20px;
}

.profile-menu {
    background: #fff;
    margin: 15px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.2s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:active {
    background: #f9f9f9;
}

.menu-icon {
    font-size: 20px;
    margin-right: 12px;
}

.menu-text {
    flex: 1;
    font-size: 15px;
    color: #333;
}

.menu-arrow {
    color: #ccc;
    font-size: 20px;
}

.menu-item.logout .menu-text {
    color: #f44336;
}

/* ===== 弹窗 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: #fff;
    border-radius: 20px;
    width: 90%;
    max-width: 340px;
    overflow: hidden;
    animation: slideUp 0.3s;
}

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

.modal-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #f5f5f5;
}

.modal-header h3 {
    font-size: 18px;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    border-top: 1px solid #f5f5f5;
}

.modal-btn {
    flex: 1;
    padding: 14px;
    border: none;
    background: none;
    font-size: 15px;
    cursor: pointer;
    border-right: 1px solid #f5f5f5;
}

.modal-btn:last-child {
    border-right: none;
}

.modal-btn.cancel {
    color: #999;
}

.modal-btn.confirm {
    color: #56AB2F;
    font-weight: 600;
}

.modal-form-group {
    margin-bottom: 15px;
}

.modal-form-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.modal-form-group input,
.modal-form-group select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
}

.modal-form-group input:focus {
    border-color: #7EC850;
}

.avatar-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.avatar-option {
    width: 50px;
    height: 50px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.avatar-option.selected {
    border-color: #56AB2F;
    background: #E8F5E9;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 2000;
    animation: toastIn 0.3s;
    max-width: 80%;
    text-align: center;
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* ===== 挤奶动画 ===== */
.milk-drop {
    position: absolute;
    font-size: 24px;
    animation: milkFall 1s ease-out forwards;
    z-index: 20;
    pointer-events: none;
}

@keyframes milkFall {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(60px) scale(0.5);
    }
}

.coin-float {
    position: fixed;
    font-size: 20px;
    animation: coinFloat 1.5s ease-out forwards;
    z-index: 3000;
    pointer-events: none;
    color: #FFD700;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

@keyframes coinFloat {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-80px);
    }
}

/* 响应式适配 */
@media (max-height: 600px) {
    .pasture-container {
        height: calc(100vh - 160px);
        min-height: 350px;
    }
    .auth-logo {
        margin-bottom: 20px;
    }
    .logo-cow {
        font-size: 60px;
    }
}

/* ===== 草场页面（新版） ===== */
#page-pasture {
    padding: 0;
}

.pasture-scene {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16;
    max-height: 60vh;
    overflow: hidden;
}

.pasture-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.grass-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.grass-bg-video.playing {
    opacity: 1;
    pointer-events: auto;
}

.pasture-harvest-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.pasture-harvest-video.playing {
    opacity: 1;
    pointer-events: auto;
}

.pasture-state-overlay {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.pasture-state-badge {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pasture-content {
    padding: 0 15px 15px;
    margin-top: -30px;
    position: relative;
    z-index: 4;
}

.pasture-header-info {
    text-align: center;
    margin-bottom: 15px;
}

.pasture-header-info h2 {
    font-size: 22px;
    color: #2E7D32;
    margin: 0 0 4px 0;
}

.pasture-header-info p {
    font-size: 13px;
    color: #666;
    margin: 0;
}

#page-pasture .pasture-actions {
    position: static;
    bottom: auto;
    left: auto;
    transform: none;
    width: 100%;
    margin-bottom: 15px;
}

.harvest-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
    transition: transform 0.15s;
}

.harvest-btn:active {
    transform: scale(0.97);
}

.harvest-btn:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}

.harvest-icon {
    font-size: 22px;
}

.pasture-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.pasture-stat-card {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 15px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.pasture-stat-icon {
    font-size: 28px;
}

.pasture-stat-info {
    flex: 1;
}

.pasture-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.pasture-stat-label {
    font-size: 11px;
    color: #999;
}

.pasture-info-tip {
    padding: 12px 15px;
    background: #E8F5E9;
    border-radius: 10px;
}

.pasture-info-tip p {
    font-size: 12px;
    color: #2E7D32;
    line-height: 1.6;
    margin: 0;
}

/* ===== 旧样式保留兼容 ===== */
.pasture-field-container {
    padding: 15px;
}

.pasture-field {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 20px;
    min-height: 280px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.pasture-field-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.pasture-field-overlay {
    text-align: center;
    padding: 20px;
    width: 100%;
    background: linear-gradient(transparent, rgba(0,0,0,0.3));
    position: relative;
    z-index: 1;
}

.pasture-field-container .pasture-actions {
    position: static;
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    transform: none;
}

.plant-btn {
    background: linear-gradient(135deg, #4CAF50, #388E3C) !important;
    color: #fff !important;
    font-weight: 600;
}

.harvest-btn {
    background: linear-gradient(135deg, #FF9800, #F57C00) !important;
    color: #fff !important;
    font-weight: 600;
}

.collect-btn {
    background: linear-gradient(135deg, #4CAF50, #2E7D32) !important;
    color: #fff !important;
    font-weight: 600;
    width: 100%;
}

.collect-btn:disabled {
    cursor: not-allowed;
}

.pasture-stats {
    display: flex;
    gap: 10px;
    padding: 0 15px;
    margin-bottom: 15px;
}

.pasture-stat-card {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 15px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.pasture-stat-icon {
    font-size: 28px;
}

.pasture-stat-info {
    flex: 1;
}

.pasture-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.pasture-stat-label {
    font-size: 11px;
    color: #999;
}

.pasture-info-tip {
    padding: 12px 15px;
    background: #FFF3E0;
    border-radius: 10px;
    margin: 0 15px;
}

.pasture-info-tip p {
    font-size: 12px;
    color: #E65100;
    line-height: 1.6;
    margin: 0;
}
