/* 存存的主页 - 后台管理样式 */

/* 后台专用变量 */
:root {
    --admin-bg: #f8f9fa;
    --admin-sidebar-bg: rgba(255, 255, 255, 0.95);
    --admin-header-bg: rgba(255, 255, 255, 0.98);
    --admin-card-bg: rgba(255, 255, 255, 0.9);
    --admin-border: rgba(255, 182, 193, 0.2);
    --admin-shadow: 0 2px 10px rgba(255, 182, 193, 0.1);
}

/* 后台页面基础样式 */
.admin-body {
    background: linear-gradient(135deg, 
        rgba(255, 182, 193, 0.1) 0%, 
        rgba(230, 230, 250, 0.1) 50%, 
        rgba(255, 249, 251, 0.2) 100%);
    min-height: 100vh;
}

/* 登录界面样式 */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--spacing-lg);
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    max-width: 1000px;
    width: 100%;
    align-items: center;
}

/* 看板娘区域 */
.mascot-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

.mascot-character {
    width: 200px;
    height: 250px;
    position: relative;
    animation: mascotFloat 3s ease-in-out infinite;
}

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

.mascot-face {
    width: 120px;
    height: 120px;
    background: var(--primary-color);
    border-radius: 50%;
    position: relative;
    margin: 0 auto;
    box-shadow: 0 5px 15px rgba(255, 182, 193, 0.3);
}

.mascot-eyes {
    display: flex;
    justify-content: space-between;
    padding: 30px 20px 0;
}

.eye {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: relative;
    animation: blink 4s infinite;
}

@keyframes blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

.pupil {
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.mascot-mouth {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 15px;
    border: 3px solid white;
    border-top: none;
    border-radius: 0 0 30px 30px;
    transition: all 0.3s ease;
}

.mascot-mouth.happy {
    border-radius: 0 0 30px 30px;
    animation: smile 0.5s ease;
}

.mascot-mouth.sad {
    border-radius: 30px 30px 0 0;
    border-top: 3px solid white;
    border-bottom: none;
    animation: frown 0.5s ease;
}

@keyframes smile {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2); }
    100% { transform: translateX(-50%) scale(1); }
}

@keyframes frown {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.1); }
    100% { transform: translateX(-50%) scale(1); }
}

.mascot-body {
    width: 80px;
    height: 100px;
    background: var(--accent-color);
    border-radius: 40px 40px 20px 20px;
    margin: 10px auto 0;
    box-shadow: 0 3px 10px rgba(230, 230, 250, 0.3);
}

.speech-bubble {
    background: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--admin-shadow);
    position: relative;
    max-width: 250px;
    text-align: center;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid white;
}

.speech-bubble p {
    margin: 0;
    color: var(--text-color);
    font-size: 0.9rem;
}

/* 登录表单样式 */
.login-form-area {
    display: flex;
    justify-content: center;
}

.login-form {
    width: 100%;
    max-width: 400px;
    padding: var(--spacing-xl);
}

.form-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.form-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.form-header p {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.form-group label {
    display: block;
    color: var(--text-color);
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--admin-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: var(--font-main);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 182, 193, 0.1);
}

.input-decoration {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.form-group input:focus + .input-decoration {
    width: 100%;
}

.captcha-group {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.captcha-group input {
    flex: 1;
}

.captcha-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--accent-color);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-weight: bold;
    color: var(--text-color);
    min-width: 80px;
    justify-content: center;
}

#refresh-captcha {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#refresh-captcha:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(180deg);
}

.login-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 182, 193, 0.3);
}

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

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

.form-footer {
    text-align: center;
    margin-top: var(--spacing-lg);
}

.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.error-message {
    background: rgba(255, 0, 0, 0.1);
    color: #d32f2f;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-md);
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 0, 0, 0.2);
}

/* 管理面板布局 */
.admin-panel {
    display: grid;
    grid-template-areas: 
        "header header"
        "sidebar main";
    grid-template-columns: 250px 1fr;
    grid-template-rows: 60px 1fr;
    min-height: 100vh;
}

.admin-header {
    grid-area: header;
    background: var(--admin-header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--admin-border);
    box-shadow: var(--admin-shadow);
    z-index: 100;
}

.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-lg);
    height: 100%;
}

.admin-title {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.admin-user {
    color: var(--text-color);
    font-size: 0.9rem;
}

.logout-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
}

.admin-sidebar {
    grid-area: sidebar;
    background: var(--admin-sidebar-bg);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--admin-border);
    box-shadow: var(--admin-shadow);
    overflow-y: auto;
}

.sidebar-nav {
    padding: var(--spacing-lg) 0;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-bottom: var(--spacing-xs);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 182, 193, 0.1);
    color: var(--primary-color);
}

.nav-item.active .nav-link {
    background: rgba(255, 182, 193, 0.2);
    color: var(--primary-color);
    border-right-color: var(--primary-color);
}

.nav-icon {
    font-size: 1.1rem;
}

.nav-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.admin-main {
    grid-area: main;
    overflow-y: auto;
    background: var(--admin-bg);
}

.admin-content {
    padding: var(--spacing-lg);
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.section-header {
    margin-bottom: var(--spacing-xl);
}

.section-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.section-header p {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 1rem;
}

/* 仪表盘样式 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--admin-card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: var(--admin-shadow);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(255, 182, 193, 0.2);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.9rem;
    font-weight: 500;
}

.dashboard-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.action-card {
    background: var(--admin-card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--admin-shadow);
}

.action-card h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: var(--spacing-md);
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.action-btn {
    background: var(--glass-bg);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    text-align: center;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(255, 182, 193, 0.3);
}

.btn-icon {
    font-size: 1.5rem;
}

.btn-text {
    font-size: 0.8rem;
    font-weight: 500;
}

.system-status {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--admin-border);
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.status-value {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.9rem;
}

.status-value.online {
    color: #4caf50;
    font-weight: 500;
}

.status-value.offline {
    color: #f44336;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .admin-panel {
        grid-template-areas:
            "header"
            "main";
        grid-template-columns: 1fr;
        grid-template-rows: 60px 1fr;
    }

    .admin-sidebar {
        position: fixed;
        top: 60px;
        left: -250px;
        width: 250px;
        height: calc(100vh - 60px);
        z-index: 200;
        transition: left 0.3s ease;
    }

    .admin-sidebar.open {
        left: 0;
    }

    .dashboard-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .login-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }

    .mascot-character {
        width: 150px;
        height: 200px;
    }

    .mascot-face {
        width: 100px;
        height: 100px;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .admin-content {
        padding: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .login-screen {
        padding: var(--spacing-md);
    }

    .login-form {
        padding: var(--spacing-lg);
    }

    .form-header h2 {
        font-size: 1.5rem;
    }

    .captcha-group {
        flex-direction: column;
        align-items: stretch;
    }

    .captcha-display {
        justify-content: space-between;
    }

    .admin-nav {
        padding: 0 var(--spacing-md);
    }

    .admin-title {
        font-size: 1rem;
    }

    .nav-right {
        gap: var(--spacing-sm);
    }

    .admin-user {
        display: none;
    }
}

/* 动画增强 */
.stat-card {
    animation: slideInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
.stat-card:nth-child(5) { animation-delay: 0.5s; }
.stat-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-card {
    animation: fadeIn 0.8s ease forwards;
    opacity: 0;
}

.action-card:nth-child(1) { animation-delay: 0.7s; }
.action-card:nth-child(2) { animation-delay: 0.8s; }

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --admin-bg: #1a1a1a;
        --admin-sidebar-bg: rgba(30, 30, 30, 0.95);
        --admin-header-bg: rgba(30, 30, 30, 0.98);
        --admin-card-bg: rgba(40, 40, 40, 0.9);
        --admin-border: rgba(255, 182, 193, 0.3);
        --text-color: #e0e0e0;
    }

    .form-group input {
        background: rgba(40, 40, 40, 0.8);
        color: #e0e0e0;
    }

    .form-group input:focus {
        background: rgba(50, 50, 50, 0.9);
    }

    .speech-bubble {
        background: rgba(40, 40, 40, 0.9);
        color: #e0e0e0;
    }

    .speech-bubble::before {
        border-bottom-color: rgba(40, 40, 40, 0.9);
    }
}
