/* ============================================================
   common.css — 公共样式（三页面共享）
   ============================================================ */

:root {
    --bg: #f5f0e8;
    --card-bg: #ffffff;
    --primary: #4a7c59;
    --accent: #e8a87c;
    --text: #3c3c3c;
    --radius: 24px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
    font-family: 'Segoe UI','PingFang SC','Microsoft YaHei','Noto Sans SC',sans-serif;
    background: var(--bg);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

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

/* ---- 卡片图片容器（公共） ---- */
.card-image {
    overflow: hidden; background: #eef2e6; position: relative;
    touch-action: none;
}
.card-image.zoom-mode { cursor: grab; }
.card-image.zoom-mode.dragging { cursor: grabbing; }
.card-image img {
    position: absolute; display: block;
    width: 100%; height: 100%;
    object-fit: contain;
    transition: opacity 0.35s ease, transform 0.3s ease;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
.card-image.zoom-mode img {
    object-fit: unset;
}

/* ---- 缩放切换按钮（公共） ---- */
.zoom-toggle {
    position: absolute; bottom: 12px; right: 12px; z-index: 10;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(0,0,0,0.45); border: none;
    color: #fff; font-size: 18px; line-height: 36px; text-align: center;
    cursor: pointer; backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.25s; display: flex;
    align-items: center; justify-content: center;
    padding: 0;
}
.zoom-toggle:active { transform: scale(0.9); background: rgba(0,0,0,0.65); }
.zoom-toggle svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }

/* ---- 卡片正文（公共） ---- */
.card-body .animal-emoji {
    position: absolute; top: 14px; right: 24px;
    font-size: clamp(36px, 7vw, 48px); line-height: 1;
    opacity: 0.85; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.card-body .animal-emoji:active { transform: scale(1.2); }
.card-body .zh-name {
    font-size: clamp(28px, 5vw, 36px); font-weight: 700; color: var(--text);
    cursor: pointer; line-height: 1.3;
}
.card-body .zh-name:active { color: var(--primary); }
.card-body .en-name {
    font-size: clamp(17px, 3.5vw, 20px); font-weight: 400; color: #888;
    cursor: pointer; margin-top: 8px; line-height: 1.4;
}
.card-body .en-name:active { color: var(--accent); }
.card-body .fact {
    font-size: clamp(12px, 2.2vw, 14px); color: #888; margin-top: 12px;
    line-height: 1.65; cursor: pointer;
}
.card-body .fact:active { color: var(--primary); }

/* ---- 离线按钮公共状态 ---- */
.btn-offline.done { background: #e8f5e9; border-color: #66bb6a; color: #2e7d32; }
.btn-offline.loading { opacity: 0.7; pointer-events: none; animation: pulse 1s ease-in-out infinite; }
