/* ============================
   engagement.css
   首页留存组件样式: 搜索/签到/每日塔罗/随机/成就墙
   ============================ */

/* ===== 全站搜索 ===== */
.home-search-wrap {
    max-width: 520px;
    margin: 0 auto 1rem;
    padding: 0 1rem;
    position: relative;
}
.home-search {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 2px solid var(--fg);
    border-radius: 24px;
    font-size: 0.95rem;
    background: var(--bg);
    color: var(--fg);
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.home-search:focus { border-color: var(--muted); }
.home-search-wrap .ss-icon-search {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--muted);
    pointer-events: none;
}
.home-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 1rem;
    right: 1rem;
    background: var(--bg);
    border: 1.5px solid var(--fg);
    border-radius: 8px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.ss-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--fg);
    text-decoration: none;
    border-bottom: 1px solid var(--light-border);
    transition: background 0.15s;
}
.ss-item:last-child { border-bottom: none; }
.ss-item:hover { background: var(--fg); color: var(--bg); }
.ss-item:hover .ss-title { color: var(--bg); }
.ss-icon { font-size: 1.2rem; flex-shrink: 0; }
.ss-title { font-size: 0.9rem; }
.ss-empty {
    padding: 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

/* ===== 每日乐园区域 ===== */
.daily-zone {
    max-width: 720px;
    margin: 0 auto 1.6rem;
    padding: 0 1rem;
}
.daily-zone-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 2px;
}
.daily-zone-title .dz-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1.5px solid var(--fg);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}
.daily-zone-title .dz-line {
    flex: 1;
    height: 1px;
    background: var(--light-border);
}
.daily-zone-title .dz-en {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: normal;
    letter-spacing: 1px;
}
.daily-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* 签到卡片 */
.checkin-card, .tarot-card, .promo-card {
    border: 2px solid var(--fg);
    border-radius: 8px;
    padding: 14px;
    background: var(--bg);
}
.checkin-card { display: flex; flex-direction: column; gap: 8px; }
.checkin-stats { display: flex; gap: 16px; font-size: 0.8rem; color: var(--muted); }
.checkin-stats b { color: var(--fg); font-size: 1.1rem; margin-right: 4px; }
.checkin-btn {
    padding: 10px;
    border: 2px solid var(--fg);
    background: var(--fg);
    color: var(--bg);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}
.checkin-btn:hover:not(:disabled) { background: var(--bg); color: var(--fg); }
.checkin-btn.checked { background: var(--bg); color: var(--muted); border-color: var(--muted); cursor: default; }
.checkin-btn:disabled { opacity: 0.7; }

/* 每日任务 */
.tarot-card { text-align: center; }
.daily-tarot-card {
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 10px 8px;
}
.daily-tarot-card .dt-placeholder {
    color: var(--muted);
    font-size: 0.85rem;
}
.dt-symbol { font-size: 2.2rem; line-height: 1; }
.dt-name { font-size: 0.95rem; font-weight: bold; letter-spacing: 0.5px; text-align: center; }
.dt-flip { animation: dtFlipIn 0.6s ease; }
@keyframes dtFlipIn {
    0% { transform: rotateY(90deg); opacity: 0; }
    100% { transform: rotateY(0); opacity: 1; }
}
.daily-task-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
.tarot-draw-btn {
    padding: 8px 16px;
    border: 1.5px solid var(--fg);
    background: var(--bg);
    color: var(--fg);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.tarot-draw-btn:hover:not(:disabled) { background: var(--fg); color: var(--bg); }
.tarot-draw-btn:disabled { color: var(--muted); border-color: var(--muted); cursor: default; }
.fan-tu-btn {
    padding: 8px 16px;
    border: 1.5px solid var(--fg);
    background: var(--fg);
    color: var(--bg);
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.fan-tu-btn:hover:not(:disabled) { background: var(--bg); color: var(--fg); }
.fan-tu-btn:disabled { opacity: 0.5; cursor: default; }
.fan-tu-desc {
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.4;
}

/* 推荐入口（群广场 / 交友） */
.promo-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1.5px solid var(--light-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--fg);
    transition: all 0.2s;
}
.promo-card:hover {
    border-color: var(--fg);
    background: var(--hover-bg);
}
.promo-icon { font-size: 1.8rem; flex-shrink: 0; }
.promo-info { flex: 1; }
.promo-title { font-size: 0.95rem; font-weight: bold; }
.promo-desc { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.promo-arrow { font-size: 1rem; color: var(--muted); flex-shrink: 0; }

/* ===== Toast ===== */
.engagement-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--fg);
    color: var(--bg);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.engagement-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== 移动端适配 ===== */
@media (max-width: 480px) {
    .home-search { padding: 10px 14px 10px 36px; font-size: 0.88rem; }
    .home-search-wrap .ss-icon-search { left: 18px; font-size: 0.9rem; }
    .daily-grid { grid-template-columns: 1fr; gap: 10px; }
    .checkin-card, .tarot-card, .promo-card { padding: 12px; }
    .dt-symbol { font-size: 2rem; }
    .engagement-toast { bottom: 96px; font-size: 0.78rem; padding: 8px 16px; }
}

/* ===== 历史中心入口 ===== */
.hc-entry {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--light-border);
}
.hc-entry-btn {
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    color: var(--fg);
    border: 1.5px solid var(--fg);
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}
.hc-entry-btn:hover {
    background: var(--fg);
    color: var(--bg);
}

/* ===== 历史中心模态框 ===== */
.hc-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    padding: 0;
}
.hc-modal.show { opacity: 1; }
.hc-modal-inner {
    background: var(--bg);
    border: 2px solid var(--fg);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.hc-modal.show .hc-modal-inner { transform: translateY(0); }
.hc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1.5px solid var(--fg);
    flex-shrink: 0;
}
.hc-title { font-size: 1rem; font-weight: bold; letter-spacing: 1px; }
.hc-close {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--fg);
    background: transparent;
    color: var(--fg);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.hc-close:hover { background: var(--fg); color: var(--bg); }
.hc-body { overflow-y: auto; padding: 12px 16px 20px; }

.hc-section { margin-bottom: 16px; }
.hc-section-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--light-border);
}
.hc-section-title { font-size: 0.9rem; font-weight: bold; flex: 1; }
.hc-section-count { font-size: 0.75rem; color: var(--muted); }
.hc-clear-btn {
    font-size: 0.7rem;
    padding: 3px 8px;
    border: 1px solid var(--muted);
    background: transparent;
    color: var(--muted);
    border-radius: 4px;
    cursor: pointer;
}
.hc-clear-btn:hover { border-color: var(--fg); color: var(--fg); }

.hc-empty {
    padding: 14px;
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
}
.hc-list { display: flex; flex-direction: column; gap: 6px; }
.hc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border: 1px solid var(--light-border);
    border-radius: 6px;
    background: rgba(0,0,0,0.02);
}
.hc-item-main { font-size: 0.85rem; font-weight: bold; }
.hc-item-sub { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.hc-item-time { font-size: 0.7rem; color: var(--muted); flex-shrink: 0; margin-left: 10px; }
.hc-view-more {
    display: block;
    text-align: center;
    padding: 8px;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--muted);
    text-decoration: none;
    border: 1px dashed var(--light-border);
    border-radius: 6px;
}
.hc-view-more:hover { color: var(--fg); border-color: var(--fg); }

.hc-all-empty {
    text-align: center;
    padding: 40px 20px;
}
.hc-all-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.hc-all-empty-text { font-size: 1rem; font-weight: bold; margin-bottom: 6px; }
.hc-all-empty-tip { font-size: 0.8rem; color: var(--muted); line-height: 1.6; }

@media (max-width: 480px) {
    .hc-modal-inner { border-radius: 12px 12px 0 0; }
    .hc-header { padding: 12px 14px; }
    .hc-body { padding: 10px 14px 16px; }
    .hc-title { font-size: 0.92rem; }
    .hc-section-title { font-size: 0.82rem; }
    .hc-item-main { font-size: 0.78rem; }
    .hc-item-sub { font-size: 0.66rem; }
    .hc-item-time { font-size: 0.64rem; }
}
