/* 家庭积分系统样式 */

/* 积分主题配色 */
:root {
    --points-primary: #4CAF50;
    --points-secondary: #2196F3;
    --points-accent: #FF9800;
    --points-success: #8BC34A;
    --points-warning: #FFC107;
    --points-danger: #F44336;
    --points-light: #F8F9FA;
    --points-dark: #212529;
    --points-gray: #6C757D;
    --points-shadow: rgba(0, 0, 0, 0.1);
    --points-gradient: linear-gradient(135deg, #4CAF50, #2196F3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #E8F5E8 0%, #E3F2FD 100%);
    color: var(--points-dark);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航 */
.points-header {
    background: white;
    box-shadow: 0 2px 10px var(--points-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.points-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    min-height: 70px;
}

.points-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--points-primary);
    flex-shrink: 0;
}

.points-logo i {
    font-size: 1.8rem;
}

/* 成员切换器样式 */
.member-switcher {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    max-width: 300px;
    margin: 0 20px;
}

.current-member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--points-gradient);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    color: white;
}

.current-member:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-avatar i {
    color: white;
    font-size: 14px;
}

.member-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.member-name {
    color: white;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-points {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
}

.member-role {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    line-height: 1.2;
}

.current-member .fas.fa-chevron-down {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.member-switcher.active .fas.fa-chevron-down {
    transform: rotate(180deg);
}

.member-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 8px;
}

.member-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.member-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.member-option:last-child {
    border-bottom: none;
}

.member-option:hover {
    background: #f8f9fa;
}

.member-option .member-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.member-option .member-info {
    flex: 1;
    min-width: 0;
}

.member-option .member-name {
    color: #333;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.member-option .member-role {
    color: #666;
    font-size: 12px;
    margin-bottom: 2px;
}

.member-option .member-points {
    color: #4CAF50;
    font-size: 12px;
    font-weight: 600;
}

.member-lock {
    color: #FF9800;
    font-size: 14px;
    flex-shrink: 0;
}

.points-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--points-primary);
    color: var(--points-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: var(--points-primary);
    color: white;
}

.points-user {
    display: flex;
    align-items: center;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: bold;
    color: var(--points-dark);
}

.user-points {
    display: block;
    font-size: 0.9rem;
    color: var(--points-primary);
    font-weight: bold;
}

/* 主要内容 */
.points-main {
    padding: 30px 0;
}

/* 积分概览 */
.points-overview {
    margin-bottom: 40px;
}

.overview-card {
    background: var(--points-gradient);
    color: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--points-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.points-display {
    text-align: center;
}

.points-number {
    font-size: 4rem;
    font-weight: bold;
    line-height: 1;
}

.points-label {
    font-size: 1.2rem;
    opacity: 0.9;
}

.level-info {
    text-align: right;
}

.level-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.total-points {
    font-size: 1rem;
    opacity: 0.9;
}

.no-child {
    text-align: center;
    width: 100%;
}

.no-child i {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.7;
}

/* 快速统计 */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-item {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px var(--points-shadow);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--points-primary);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--points-gray);
    font-size: 0.9rem;
}

/* 区块标题 */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--points-dark);
    margin-bottom: 20px;
}

.section-title i {
    color: var(--points-primary);
}

/* 任务区块 */
.tasks-section {
    margin-bottom: 40px;
}

.task-category {
    margin-bottom: 30px;
}

.category-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--points-secondary);
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid var(--points-secondary);
}

.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.task-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--points-shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.task-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--points-shadow);
}

.task-icon {
    font-size: 2rem;
    width: 50px;
    text-align: center;
}

.task-info {
    flex: 1;
}

.task-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--points-dark);
}

.task-desc {
    font-size: 0.9rem;
    color: var(--points-gray);
    margin-bottom: 8px;
}

.task-points {
    font-weight: bold;
    font-size: 0.9rem;
}

.task-points.positive {
    color: var(--points-success);
}

.task-points.negative {
    color: var(--points-danger);
}

.task-btn {
    padding: 8px 16px;
    background: var(--points-primary);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.task-btn:hover {
    background: #45a049;
}

/* 奖励区块 */
.rewards-section {
    margin-bottom: 40px;
}

.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.reward-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--points-shadow);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.reward-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--points-shadow);
}

.reward-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.reward-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--points-dark);
}

.reward-desc {
    font-size: 0.9rem;
    color: var(--points-gray);
    margin-bottom: 15px;
}

.reward-cost {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--points-accent);
    margin-bottom: 15px;
}

.reward-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.reward-btn.available {
    background: var(--points-accent);
    color: white;
}

.reward-btn.available:hover {
    background: #f57c00;
}

.reward-btn.unavailable {
    background: var(--points-gray);
    color: white;
    cursor: not-allowed;
}

/* 记录区块 */
.records-section {
    margin-bottom: 40px;
}

.records-list {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--points-shadow);
    overflow: hidden;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.record-item:last-child {
    border-bottom: none;
}

.record-info {
    flex: 1;
}

.record-title {
    font-weight: bold;
    margin-bottom: 3px;
    color: var(--points-dark);
}

.record-meta {
    font-size: 0.8rem;
    color: var(--points-gray);
}

.record-points {
    font-weight: bold;
    font-size: 1.1rem;
    padding: 5px 10px;
    border-radius: 10px;
}

.record-points.positive {
    color: var(--points-success);
    background: rgba(139, 195, 74, 0.1);
}

.record-points.negative {
    color: var(--points-danger);
    background: rgba(244, 67, 54, 0.1);
}

.no-records {
    text-align: center;
    padding: 40px;
    color: var(--points-gray);
}

.no-records i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--points-dark);
}

.modal-message {
    color: var(--points-gray);
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.modal-btn:not(.cancel) {
    background: var(--points-primary);
    color: white;
}

.modal-btn:not(.cancel):hover {
    background: #45a049;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-btn.cancel {
    background: var(--points-gray);
    color: white;
}

.modal-btn.cancel:hover {
    background: #5a6268;
}

.modal-btn.confirm {
    background: var(--points-primary);
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .points-nav {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        padding: 15px 0 20px 0;
    }
    
    .points-logo {
        order: 1;
    }
    
    .member-switcher {
        order: 2;
        margin: 0;
        max-width: 280px;
        width: 100%;
    }
    
    .points-actions {
        order: 3;
    }
    
    .current-member {
        min-width: 250px;
        width: 100%;
    }
    
    .member-dropdown {
        left: 0;
        right: 0;
        width: 100%;
    }
    
    .overview-card {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .level-info {
        text-align: center;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .task-grid {
        grid-template-columns: 1fr;
    }
    
    .task-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .rewards-grid {
        grid-template-columns: 1fr;
    }
    
    .record-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .record-points {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .points-main {
        padding: 20px 0;
    }
    
    .points-nav {
        padding: 10px 0 15px 0;
    }
    
    .points-logo {
        font-size: 1.3rem;
    }
    
    .member-switcher {
        max-width: 240px;
    }
    
    .current-member {
        min-width: 200px;
        padding: 6px 10px;
    }
    
    .member-name {
        font-size: 13px;
    }
    
    .member-points {
        font-size: 11px;
    }
    
    .member-dropdown {
        width: 100%;
    }
    
    .member-option {
        padding: 10px 12px;
    }
    
    .member-option .member-avatar {
        width: 36px;
        height: 36px;
    }
    
    .overview-card {
        padding: 20px;
    }
    
    .points-number {
        font-size: 3rem;
    }
    
    .task-card,
    .reward-card {
        padding: 15px;
    }
    
    .modal-content {
        padding: 20px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-card,
.reward-card,
.stat-item {
    animation: fadeInUp 0.6s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 成功动画 */
.success-animation {
    animation: bounce 0.6s ease-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}