/* 全局样式 - 黑白+深紫主题 */
:root {
    /* 主色调 - 深紫色 */
    --primary-color: #6B46C1;        /* 深紫色 */
    --primary-dark: #553C9A;         /* 更深的紫色 */
    --primary-light: #805AD5;        /* 浅紫色 */
    
    /* 强调色 - 橙色/米色 */
    --accent-orange: #FF8C42;        /* 温暖的橙色 */
    --accent-beige: #F5DEB3;         /* 米色 */
    --accent-warm: #FFB84D;          /* 暖黄色 */
    
    /* 黑白灰色系 */
    --black: #0A0A0A;                /* 纯黑 */
    --gray-900: #1A1A1A;             /* 深灰 */
    --gray-800: #2D2D2D;             /* 灰色 */
    --gray-700: #404040;             /* 中灰 */
    --gray-600: #666666;             /* 浅灰 */
    --gray-500: #999999;             /* 更浅灰 */
    --gray-400: #CCCCCC;             /* 淡灰 */
    --gray-300: #E5E5E5;             /* 很淡灰 */
    --white: #FFFFFF;                /* 纯白 */
    
    /* 功能色 */
    --secondary-color: #50c878;      /* 成功绿色 */
    --danger-color: #e74c3c;         /* 危险红色 */
    --warning-color: var(--accent-orange);  /* 警告色使用橙色 */
    
    /* 文字颜色 */
    --text-color: var(--white);
    --text-light: var(--gray-400);
    --text-muted: var(--gray-500);
    
    /* 背景色 */
    --bg-color: var(--black);
    --bg-secondary: var(--gray-900);
    --card-bg: var(--gray-800);
    --nav-bg: var(--gray-900);
    
    /* 边框和阴影 */
    --border-color: var(--gray-700);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 4px 16px rgba(107, 70, 193, 0.3);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.4);
    --shadow-purple: 0 4px 16px rgba(107, 70, 193, 0.2);
    
    /* 圆角 */
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;
    
    /* 过渡效果 */
    --transition: all 0.3s ease;
    
    /* 触摸目标尺寸 */
    --touch-target-size: 44px;
}

/* 黑夜模式 - 已移除，使用自定义主题 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 全局链接样式 */
a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-orange);
    text-decoration: underline;
}

/* 导航栏 */
#main-nav {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
    border-bottom: 2px solid var(--primary-color);
    min-height: 60px; /* 最小高度 60px */
}

@media (min-width: 768px) {
    #main-nav {
        min-height: 72px; /* md: 72px */
    }
}

.nav-container {
    max-width: 1280px; /* container max-width */
    margin: 0 auto;
    padding: 1rem; /* px-4 */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (min-width: 768px) {
    .nav-container {
        padding: 1rem 2rem;
    }
}

@media (min-width: 1024px) {
    .nav-container {
        padding: 1rem 4rem;
    }
}

.logo {
    font-size: 1.5rem;
    color: var(--white);
    font-weight: bold;
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-warm) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--white);
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.nav-menu a:hover {
    color: var(--accent-orange);
    background-color: rgba(107, 70, 193, 0.2);
    transform: translateY(-2px);
}

.nav-menu a.active {
    color: var(--accent-orange);
    font-weight: bold;
    background-color: rgba(107, 70, 193, 0.3);
    border-bottom: 2px solid var(--accent-orange);
}

.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--white);
    margin: 3px 0;
    transition: var(--transition);
}

/* 主内容区 */
#app-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: calc(100vh - 200px);
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: var(--text-light);
}

/* Toast 提示 */
#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background-color: var(--card-bg);
    color: #ffffff;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    min-width: 250px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--secondary-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.info {
    border-left: 4px solid var(--primary-color);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 通用工具类 */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
    display: none !important;
}


/* 平滑过渡效果 */
.smooth-transition {
    transition: var(--transition);
}

/* 页面内容淡入动画 */
#app-content > * {
    animation: contentFadeIn 0.4s ease;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 按钮点击效果 */
.btn:active {
    transform: scale(0.98);
}

/* 卡片悬停效果增强 */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
}

/* 输入框聚焦效果 */
.form-control {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.4);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    }
}

/* 列表项动画 */
.list-item,
.pet-card,
.news-card,
.blog-card {
    animation: itemSlideIn 0.4s ease;
}

@keyframes itemSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 错误抖动动画 */
.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* 成功脉冲动画 */
.pulse-success {
    animation: pulseSuccess 0.6s ease;
}

@keyframes pulseSuccess {
    0% {
        box-shadow: 0 0 0 0 rgba(80, 200, 120, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(80, 200, 120, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(80, 200, 120, 0);
    }
}

/* 加载骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 进度条 */
.progress-bar {
    height: 4px;
    background-color: var(--primary-color);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    transition: width 0.3s ease;
}

/* 模态框淡入 */
.modal {
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 工具提示 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tooltip:hover::after {
    opacity: 1;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* 选择文本样式 */
::selection {
    background-color: rgba(74, 144, 226, 0.3);
    color: #ffffff;
}

/* 焦点可见性 */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 禁用状态 */
.disabled,
[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* 加载旋转器 */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 空状态插图 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* 响应式图片 */
img {
    max-width: 100%;
    height: auto;
}

/* 无障碍 - 跳过导航链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* 用户区域样式 */
.user-area {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.user-info {
    color: var(--white);
    font-weight: 500;
    margin-right: 8px;
}

.btn-admin {
    background-color: #FF9800;
    color: white;
}

.btn-admin:hover {
    background-color: #F57C00;
}

.btn-success {
    background-color: #4CAF50;
    color: white;
}

.btn-success:hover {
    background-color: #45a049;
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--white);
}

.btn-warning:hover {
    background-color: #e0a800;
}

/* 响应式：移动设备上用户区域 */
@media (max-width: 768px) {
    .user-area {
        margin-left: 0;
        margin-top: 10px;
        justify-content: center;
    }
    
    .user-profile {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .user-details {
        align-items: center;
    }
    
    .user-menu {
        justify-content: center;
    }
    
    .nav-container {
        flex-wrap: wrap;
    }
}

/* 用户头像样式 */
.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--white);
}

.user-name {
    font-weight: 500;
    color: var(--white);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 2px solid var(--accent-orange);
    box-shadow: 0 2px 8px rgba(107, 70, 193, 0.3);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.user-menu {
    display: flex;
    gap: 8px;
}

.admin-badge {
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-warm) 100%);
    color: var(--white);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(255, 140, 66, 0.3);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* 选择文本样式 */
::selection {
    background-color: rgba(74, 144, 226, 0.3);
    color: #ffffff;
}

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #2d2d2d 25%, #3d3d3d 50%, #2d2d2d 75%);
    background-size: 200% 100%;
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-light);
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background-color: var(--gray-700);
    color: var(--white);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.pet-detail-info p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.pet-detail-info strong {
    color: var(--primary-light);
    margin-right: 8px;
}

/* 响应式弹窗 */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        max-height: 95vh;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 16px;
    }
}
