/* ================================================
   碳路者·青碳行 - Web Demo 全局样式
   ================================================ */

/* ---------- 全局基础 ---------- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #e2e8f0;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

* {
    box-sizing: border-box;
}

/* ---------- 主容器（全宽度无「手机外框」黑边） ---------- */
.phone-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    position: relative;
    background: #ffffff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
}

/* ---------- 可滚动区域 ---------- */
.scrollable-content {
    flex: 1;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollable-content::-webkit-scrollbar {
    display: none;
}

/* ---------- Tab 高亮激活态 ---------- */
.tab-active {
    color: #10b981;
}

/* ---------- 能量球浮动动画 ---------- */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.energy-ball {
    animation: float 3s ease-in-out infinite;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}

.energy-ball:hover {
    transform: scale(1.1);
}

.energy-ball.collected {
    animation: none;
    opacity: 0.5;
    pointer-events: none;
}

@keyframes collect {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}

/* ---------- 能量增加弹出动画 ---------- */
@keyframes scorePopup {
    0% { opacity: 0; transform: translateY(0) scale(0.8); }
    20% { opacity: 1; transform: translateY(-20px) scale(1); }
    80% { opacity: 1; transform: translateY(-50px) scale(1); }
    100% { opacity: 0; transform: translateY(-70px) scale(0.8); }
}

.score-popup {
    position: fixed;
    font-size: 16px;
    font-weight: bold;
    color: #10b981;
    pointer-events: none;
    animation: scorePopup 1s ease-out forwards;
    white-space: nowrap;
    z-index: 100;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ---------- 打卡按钮状态 ---------- */
.checkin-btn {
    transition: all 0.2s ease;
    cursor: pointer;
}

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

.checkin-btn.completed {
    opacity: 0.6;
    cursor: default;
}

/* ---------- Toast 提示 ---------- */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 9999;
    pointer-events: none;
    animation: toastIn 0.3s ease;
    max-width: 80%;
    text-align: center;
}

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

/* ---------- 弹窗遮罩 ---------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 24px;
    width: 100%;
    max-width: 340px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

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

/* ---------- 排行榜 Tab ---------- */
.rank-tab {
    position: relative;
    color: #94a3b8;
    transition: color 0.2s ease;
    cursor: pointer;
}

.rank-tab.active {
    color: #10b981;
}

/* ---------- 登录页面按钮 ---------- */
.btn-primary {
    background: #10b981;
    color: white;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #059669;
}

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

/* ---------- 商品卡片点击效果 ---------- */
.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-card:active {
    transform: scale(0.98);
}

/* ---------- 分类Tab选中效果 ---------- */
.category-tab {
    transition: all 0.2s ease;
    cursor: pointer;
}

.category-tab:hover {
    transform: scale(1.05);
}

/* ---------- 功能菜单项 ---------- */
.profile-menu-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.profile-menu-item:hover {
    background-color: #f9fafb;
}

/* ---------- 资讯项 ---------- */
.article-item {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.article-item:hover {
    transform: translateX(4px);
}

/* ---------- 活动卡片 ---------- */
.activity-card {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.activity-card:hover {
    transform: scale(1.02);
}

/* ---------- 周报卡片 ---------- */
.weekly-report-card {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.weekly-report-card:hover {
    transform: scale(1.02);
}

/* ---------- 任务项 ---------- */
.task-item {
    transition: opacity 0.2s ease;
}

/* ---------- 滚动条隐藏 ---------- */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
