* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f7fa; color: #0f172a; font-size: 14px; line-height: 1.6; }

.hidden { display: none !important; }
.topbar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.98); backdrop-filter: blur(10px); border-bottom: 1px solid #e2e8f0; }
.topbar-inner { max-width: 750px; margin: 0 auto; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
.topbar-title { font-size: 17px; font-weight: 600; }
.topbar-user { font-size: 20px; cursor: pointer; }

.main { max-width: 750px; margin: 0 auto; padding: 16px; padding-bottom: 80px; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,0.98); backdrop-filter: blur(10px); border-top: 1px solid #e2e8f0; z-index: 100; }
.tabbar-inner { max-width: 750px; margin: 0 auto; display: flex; height: 60px; }
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #94a3b8; cursor: pointer; transition: color 0.2s; }
.tab-item.active { color: #0ea5e9; }
.tab-icon { font-size: 22px; line-height: 1; }
.tab-name { font-size: 11px; font-weight: 500; }

.card { background: #fff; border-radius: 16px; box-shadow: 0 4px 16px rgba(15,23,42,0.06); padding: 20px; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: #0f172a; }

.btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 46px; padding: 0 20px; border: none; border-radius: 10px; font-size: 15px; font-weight: 500; cursor: pointer; transition: all 0.15s; background: #0ea5e9; color: #fff; }
.btn:hover:not(:disabled) { background: #0284c7; box-shadow: 0 6px 16px rgba(14,165,233,0.3); }
.btn:disabled { background: #cbd5e1; cursor: not-allowed; }
.btn-secondary { background: #f1f5f9; color: #475569; }
.btn-secondary:hover:not(:disabled) { background: #e2e8f0; box-shadow: none; }
.btn-success { background: #10b981; }
.btn-success:hover:not(:disabled) { background: #059669; }
.btn-danger { background: #ef4444; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-group { display: flex; gap: 8px; }

.form-item { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: #475569; margin-bottom: 6px; font-weight: 500; }
.form-input { width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 15px; outline: none; transition: all 0.2s; background: #fff; }
.form-input:focus { border-color: #0ea5e9; box-shadow: 0 0 0 4px rgba(14,165,233,0.12); }
textarea.form-input { height: auto; min-height: 100px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.form-tip { font-size: 12px; color: #94a3b8; margin-top: 6px; }
.required { color: #ef4444; }

.info-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed #e2e8f0; font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-label { color: #64748b; }
.info-value { color: #0f172a; font-weight: 500; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-primary { background: #e0f2fe; color: #0369a1; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-gray { background: #f1f5f9; color: #64748b; }

.msg { font-size: 13px; min-height: 20px; margin-top: 8px; }
.msg-error { color: #ef4444; }
.msg-success { color: #10b981; }

.role-switch { display: flex; gap: 8px; background: #f1f5f9; border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.role-btn { flex: 1; padding: 10px; border: none; border-radius: 10px; background: transparent; font-size: 14px; color: #64748b; cursor: pointer; font-weight: 500; }
.role-btn.active { background: #0ea5e9; color: #fff; box-shadow: 0 4px 12px rgba(14,165,233,0.25); }
.role-btn.secondary.active { background: #8b5cf6; }

.task-card { background: #fff; border-radius: 16px; box-shadow: 0 4px 16px rgba(15,23,42,0.06); padding: 16px; margin-bottom: 12px; }
.task-image { width: 100%; height: 160px; background: #f1f5f9; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #94a3b8; margin-bottom: 12px; overflow: hidden; }
.task-image img { width: 100%; height: 100%; object-fit: cover; }
.task-name { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.task-desc { font-size: 13px; color: #64748b; margin-bottom: 12px; }

.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(15,23,42,0.9); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 14px; z-index: 9999; max-width: 300px; text-align: center; }

.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 24px; }
.modal-box { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 24px; max-height: 80vh; overflow-y: auto; }
.modal-title { font-size: 18px; font-weight: 600; text-align: center; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; margin-top: 16px; }

.avatar-circle { width: 64px; height: 64px; border-radius: 50%; background: #0ea5e9; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 600; margin: 0 auto 12px; overflow: hidden; }
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

.empty { text-align: center; padding: 60px 20px; color: #94a3b8; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }

.loading { text-align: center; padding: 40px; color: #94a3b8; }

/* 树状图 */
.tree-wrap { padding: 8px 0; overflow-x: auto; }
.tree-farm { font-size: 14px; font-weight: 600; color: #0369a1; margin-bottom: 12px; text-align: center; }
.tree-level { padding-left: 0; }
.tree-children { padding-left: 20px; border-left: 2px dashed #e2e8f0; margin: 4px 0 4px 14px; }
.tree-branch { margin: 6px 0; }
.tree-node {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 10px;
    background: #f1f5f9; font-size: 13px;
    margin: 2px 0; white-space: nowrap;
    border: 1.5px solid transparent;
}
.tree-node.tree-owner { background: #fef3c7; color: #92400e; }
.tree-node.tree-manager { background: #e0f2fe; color: #0369a1; }
.tree-node.tree-leader { background: #ede9fe; color: #6d28d9; }
.tree-node.tree-sub { background: #f1f5f9; color: #475569; }
.tree-node.tree-daren { background: #d1fae5; color: #065f46; }
.tree-node.tree-me { background: #0ea5e9 !important; color: #fff !important; box-shadow: 0 4px 12px rgba(14,165,233,0.3); border-color: #0284c7; }
.tree-role { font-size: 11px; opacity: 0.75; }
.tree-name { font-weight: 500; }
.tree-badge { background: #fff; color: #0ea5e9; font-size: 10px; padding: 1px 6px; border-radius: 8px; font-weight: 700; margin-left: 4px; }

/* 子页面入口 */
.sub-entry {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
}
.sub-entry:last-child { border-bottom: none; }
.sub-entry:active { background: #f8fafc; }
.sub-entry-name {
    font-size: 15px;
    color: #0f172a;
    font-weight: 500;
    margin-right: 12px;
    flex-shrink: 0;
}
.sub-entry-desc {
    font-size: 12px;
    color: #94a3b8;
    flex: 1;
    text-align: left;
}
.sub-entry-arrow {
    font-size: 20px;
    color: #cbd5e1;
    margin-left: 8px;
}

/* 微信风格列表 */
.list-item { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: background 0.15s; }
.list-item:last-child { border-bottom: none; }
.list-item:active { background: #f8fafc; }
.list-label { flex-shrink: 0; font-size: 15px; color: #0f172a; }
.list-value { flex: 1; text-align: right; font-size: 14px; color: #64748b; margin: 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-arrow { font-size: 20px; color: #cbd5e1; flex-shrink: 0; }

/* 主选项卡 */
.main-tabs {
    display: flex;
    background: #fff;
    border-radius: 14px;
    padding: 6px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    gap: 6px;
}
.main-tab {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}
.main-tab.active {
    background: #0ea5e9;
    color: #fff;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* 子选项卡 */
.sub-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 10px;
    box-shadow: none;
}
.sub-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 18px;
    border: none;
    border-radius: 18px;
    background: #f1f5f9;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: none;
    flex: none;
    width: auto;
    height: auto;
    line-height: 1.4;
}
.sub-tab.active {
    background: #0ea5e9;
    color: #fff;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    font-weight: 600;
}

/* ============================================================ */
/* 池子进度 - 最终版 */
/* ============================================================ */
.pool-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
    border: 1.5px solid #bae6fd;
    transition: all 0.4s;
}
.pool-card:last-child { margin-bottom: 0; }
.pool-card.full {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fbbf24;
    animation: poolGlow 2s ease-in-out infinite;
}












.pool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.pool-name {
    font-weight: 700;
    color: #0369a1;
    font-size: 16px;
}
.pool-card.full .pool-name { color: #92400e; }
.pool-count {
    color: #0ea5e9;
    font-weight: 700;
    font-size: 16px;
    font-family: monospace;
}
.pool-card.full .pool-count { color: #d97706; }

.pool-progress-wrap { margin-bottom: 14px; }
.pool-progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.7);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}
.pool-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}
.pool-progress-text {
    font-size: 12px;
    color: #64748b;
    text-align: right;
}
.pool-card.full .pool-progress-text { color: #d97706; font-weight: 600; }

.pool-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.pool-slot {
    aspect-ratio: 1;
    background: #fff;
    border: 1.5px solid #7dd3fc;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(14,165,233,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s;
}
.pool-slot .fish {
    display: inline-block;
    font-size: 24px;
    line-height: 1;
    transform: scale(var(--fish-scale, 0.5));
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: fishFloat 3s ease-in-out infinite;
}
.pool-slot:nth-child(2n) .fish { animation-delay: 0.4s; }
.pool-slot:nth-child(3n) .fish { animation-delay: 0.8s; }
.pool-slot:nth-child(5n) .fish { animation-delay: 1.2s; }

.pool-card.full .pool-slot {
    border-color: #fbbf24;
    box-shadow: 0 2px 10px rgba(251,191,36,0.35);
}
.pool-card.full .pool-slot .fish {
    animation: fishJump 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 6px rgba(251,191,36,0.8));
}
.pool-card.full 
.pool-card.full 
.pool-full-tip {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #d97706;
}

@keyframes fishFloat {
    0%, 100% { transform: scale(var(--fish-scale, 0.5)) translateY(0); }
    50% { transform: scale(var(--fish-scale, 0.5)) translateY(-3px); }
}
@keyframes fishJump {
    0%, 100% { transform: scale(var(--fish-scale, 0.5)) translateY(0); }
    50% { transform: scale(calc(var(--fish-scale, 0.5) * 1.08)) translateY(-5px); }
}


@keyframes poolGlow {
    0%, 100% { box-shadow: 0 0 0 rgba(251,191,36,0); }
    50% { box-shadow: 0 0 24px rgba(251,191,36,0.5); }
}
/* ============================================================ */
/* 池子水波纹 + 气泡（加强版） */
/* ============================================================ */

/* 水波纹：两条波纹横穿池子，持续移动 */
.pool-card::before {
    content: '';
    position: absolute;
    left: -100%;
    right: -100%;
    bottom: 0;
    height: 40px;
    background:
        radial-gradient(ellipse 50% 100% at 25% 100%, rgba(56,189,248,0.45) 0%, transparent 60%),
        radial-gradient(ellipse 50% 100% at 75% 100%, rgba(56,189,248,0.35) 0%, transparent 60%),
        linear-gradient(to top, rgba(125,211,252,0.25), transparent);
    animation: waterWave 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* 气泡容器 */
.pool-bubbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.pool-bubbles .bubble {
    position: absolute;
    bottom: -20px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,1), rgba(56,189,248,0.6));
    box-shadow: inset 0 0 6px rgba(255,255,255,0.9), 0 0 10px rgba(56,189,248,0.5);
    border: 1px solid rgba(255,255,255,0.7);
    animation: bubbleRise linear infinite;
    opacity: 0;
}
.pool-bubbles .bubble:nth-child(1) { left: 6%;  width: 12px; height: 12px; animation-duration: 6s;  animation-delay: 0s; }
.pool-bubbles .bubble:nth-child(2) { left: 18%; width: 8px;  height: 8px;  animation-duration: 8s;  animation-delay: 1.2s; }
.pool-bubbles .bubble:nth-child(3) { left: 32%; width: 14px; height: 14px; animation-duration: 7s;  animation-delay: 2.5s; }
.pool-bubbles .bubble:nth-child(4) { left: 46%; width: 10px; height: 10px; animation-duration: 9s;  animation-delay: 0.8s; }
.pool-bubbles .bubble:nth-child(5) { left: 60%; width: 16px; height: 16px; animation-duration: 6.5s; animation-delay: 3.2s; }
.pool-bubbles .bubble:nth-child(6) { left: 74%; width: 9px;  height: 9px;  animation-duration: 7.5s; animation-delay: 1.8s; }
.pool-bubbles .bubble:nth-child(7) { left: 88%; width: 11px; height: 11px; animation-duration: 8.5s; animation-delay: 2.8s; }

@keyframes waterWave {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(30px); }
}
@keyframes bubbleRise {
    0% {
        transform: translateY(0) scale(0.6);
        opacity: 0;
    }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% {
        transform: translateY(-150px) scale(1.15);
        opacity: 0;
    }
}

/* 满员时：气泡金色 + 加速 */
.pool-card.full .pool-bubbles .bubble {
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,1), rgba(251,191,36,0.8));
    box-shadow: inset 0 0 6px rgba(255,255,255,0.9), 0 0 12px rgba(251,191,36,0.7);
    border-color: rgba(255,255,255,0.9);
}
.pool-card.full .pool-bubbles .bubble:nth-child(odd) {
    animation-duration: 4s;
}