/* ============================================
   小怡的秘密基地 - 可爱卡通风格
   ============================================ */

/* ---------- 基础重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 30%, #e8eaf6 60%, #e0f7fa 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---------- 漂浮装饰元素 ---------- */
.floating-elements {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.float-item {
    position: absolute;
    font-size: 2rem;
    opacity: 0.6;
    animation: floatAround 6s ease-in-out infinite;
}

@keyframes floatAround {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(10deg); }
    50% { transform: translateY(-10px) rotate(-5deg); }
    75% { transform: translateY(-25px) rotate(8deg); }
}

/* ============================================
   登录页面
   ============================================ */
.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow:
        0 20px 60px rgba(233, 30, 99, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    animation: cardAppear 0.6s ease-out;
}

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

/* 顶部区域 */
.card-top {
    text-align: center;
    margin-bottom: 35px;
}

.mascot {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.card-top h1 {
    font-size: 1.8rem;
    color: #5c2d91;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 2px;
}

.subtitle {
    color: #9c27b0;
    font-size: 0.95rem;
    opacity: 0.8;
}

/* ---------- 表单样式 ---------- */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #6a1b9a;
    font-size: 0.9rem;
    font-weight: 600;
}

.label-icon {
    font-size: 1rem;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    padding-right: 50px;
    border: 2px solid #e8eaf6;
    border-radius: 16px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    color: #333;
    outline: none;
}

.input-group input:focus {
    border-color: #ce93d8;
    box-shadow: 0 0 0 4px rgba(206, 147, 216, 0.15);
    background: #fff;
}

.input-group input::placeholder {
    color: #bbb;
    font-size: 0.9rem;
}

/* 密码切换按钮 */
.toggle-pwd {
    position: absolute;
    right: 12px;
    bottom: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: background 0.2s;
}

.toggle-pwd:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* 登录按钮 */
.login-btn {
    padding: 16px 24px;
    background: linear-gradient(135deg, #e040fb, #7c4dff);
    border: none;
    border-radius: 18px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 77, 255, 0.35);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 按钮加载动画 */
.login-btn.loading {
    pointer-events: none;
}

.login-btn.loading span {
    opacity: 0;
}

.login-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
}

.login-btn.loading::after {
    animation: btnShimmer 1.5s infinite;
}

@keyframes btnShimmer {
    100% { transform: translateX(100%); }
}

/* 提示消息 */
.message {
    text-align: center;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 0.95rem;
    animation: msgPop 0.3s ease-out;
}

@keyframes msgPop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.message.error {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* 底部 */
.card-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px dashed #e8eaf6;
}

.card-footer p {
    color: #999;
    font-size: 0.85rem;
}

.card-footer strong {
    color: #7c4dff;
    background: #f3e5f5;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* ============================================
   登录后主页 (Dashboard)
   ============================================ */
.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* 顶部导航 */
.dash-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.03);
}

.dash-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: #5c2d91;
}

.dash-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    font-size: 1.8rem;
}

.user-name {
    font-size: 1rem;
    font-weight: 600;
    color: #5c2d91;
}

.logout-btn {
    padding: 8px 18px;
    background: #fce4ec;
    color: #c62828;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #f8bbd0;
    transform: translateY(-1px);
}

/* 主内容 */
.dash-main {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
}

.welcome-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    animation: cardAppear 0.6s ease-out;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.welcome-card h1 {
    font-size: 1.8rem;
    color: #5c2d91;
    margin-bottom: 10px;
}

.welcome-text {
    color: #7c4dff;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.status-badge {
    display: inline-block;
    padding: 8px 24px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* 功能卡片网格 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    animation: cardAppear 0.6s ease-out;
    animation-fill-mode: backwards;
}

.info-card:nth-child(1) { animation-delay: 0.1s; }
.info-card:nth-child(2) { animation-delay: 0.2s; }
.info-card:nth-child(3) { animation-delay: 0.3s; }

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.info-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.info-card h3 {
    color: #5c2d91;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.info-card p {
    color: #888;
    font-size: 0.9rem;
}

/* 底部 */
.dash-footer {
    text-align: center;
    padding: 20px;
    color: #aaa;
    font-size: 0.85rem;
}

.dash-footer p {
    opacity: 0.8;
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }

    .card-top h1 {
        font-size: 1.5rem;
    }

    .mascot {
        font-size: 3rem;
    }

    .dash-header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 10px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}
