/* 仪表板样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    padding: 20px;
}

/* 侧边栏展开时，sidebar.css 会自动设置 padding-left: 250px */

/* 容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 页面头部 */
.page-header {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 新版顶部导航样式 */
.container > header {
    background: white;
    padding: 25px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    animation: slideInDown 0.5s ease-out;
}

#welcomeBanner {
    max-width: 650px;
}

#welcomeBanner > div {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#welcomeBanner > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#welcomeBanner > div {
    padding: 14px 18px !important;
}

#welcomeText {
    line-height: 1.5;
}

#welcomeText > div:first-child {
    font-weight: normal;
    font-size: 14px;
    color: #374151;
}

/* 欢迎横幅头像容器 */
#welcomeBanner .user-avatar,
#welcomeBanner > div > div:first-child {
    width: 36px !important;
    height: 36px !important;
    font-size: 20px !important;
}

#welcomeBanner img {
    width: 36px !important;
    height: 36px !important;
}

/* 系统主页按钮样式与客户管理保持一致 */
.container > header .header-actions .btn,
.container > header .header-actions a.btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.container > header .header-actions {
    gap: 10px;
}

.header-left h1 {
    font-size: 32px;
    color: #333;
    margin-bottom: 8px;
}

.welcome-text {
    font-size: 16px;
    color: #666;
}

.welcome-text span {
    color: #667eea;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 用户头像 */
.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-initial {
    color: white;
    font-size: 18px;
    font-weight: bold;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary {
    background: #f1f3f5;
    color: #495057;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 统计卡片网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeInScale 0.6s ease-out backwards;
}

.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::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #667eea, #764ba2);
    transition: width 0.4s ease;
}

.stat-card::after {
    content: '✨';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    opacity: 0;
    transform: scale(0) rotate(-30deg);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.25);
}

.stat-card:hover::before {
    width: 100%;
    opacity: 0.08;
}

.stat-card:hover::after {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.stat-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: inline-block;
    transition: transform 0.3s ease;
    animation: bounce 2s ease-in-out infinite;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
    animation: none;
}

.stat-content h3 {
    font-size: 18px;
    color: #495057;
    margin-bottom: 15px;
    font-weight: 600;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-number {
    transform: scale(1.05);
}

.count-loading {
    font-size: 16px;
    color: #adb5bd;
}

.stat-label {
    font-size: 13px;
    color: #868e96;
    margin-bottom: 12px;
    font-weight: 500;
}

.stat-details {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #6c757d;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.detail-item strong {
    color: #495057;
}

.stat-action {
    margin-top: 15px;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
}

/* 卡片主题色 - 使用渐变 */
.todo-card .stat-number { 
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.client-card .stat-number { 
    background: linear-gradient(135deg, #51cf66, #37b24d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.ticket-card .stat-number { 
    background: linear-gradient(135deg, #ff6b6b, #fa5252);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.bookmark-card .stat-number { 
    background: linear-gradient(135deg, #ffa94d, #fd7e14);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 区域标题 */
.section-title {
    font-size: 24px;
    color: white;
    margin-bottom: 20px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    padding-left: 15px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 24px;
    background: white;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 快捷操作区域 */
.quick-actions {
    margin-bottom: 40px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.action-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.action-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

.action-card:hover::before {
    opacity: 1;
}

.action-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.action-card:hover .action-icon {
    transform: rotate(360deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.action-content h4 {
    font-size: 16px;
    color: #333;
    position: relative;
    z-index: 1;
    margin-bottom: 5px;
}

.action-content p {
    font-size: 13px;
    color: #868e96;
}

/* 系统管理区域 */
.system-section {
    margin-bottom: 40px;
}

/* 最近活动区域 */
.recent-activity {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: fadeInScale 0.6s ease-out 0.5s backwards;
}

.recent-activity .section-title {
    color: #333;
    margin-bottom: 20px;
    padding-left: 0;
    text-shadow: none;
}

.recent-activity .section-title::before {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.activity-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.summary-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.summary-item:hover {
    transform: translateY(-3px);
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.summary-item:hover::before {
    transform: scaleX(1);
}

.summary-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.summary-value {
    font-size: 28px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-value.warning {
    background: linear-gradient(135deg, #ff8c00, #ff6b00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-value.urgent {
    background: linear-gradient(135deg, #ff6b6b, #fa5252);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 温馨页脚 */
.dashboard-footer {
    margin-top: 40px;
    text-align: center;
    padding: 30px 20px;
}

.footer-quote {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 30px;
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: floatUpDown 3s ease-in-out infinite;
}

.quote-icon {
    font-size: 24px;
    animation: pulse 2s ease-in-out infinite;
}

.quote-text {
    font-size: 15px;
    color: #495057;
    font-weight: 500;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* 音乐控制按钮 */
.music-control {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    animation: bounceIn 0.8s ease-out;
}

.music-control:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.music-control.playing {
    animation: musicPulse 1.5s ease-in-out infinite;
}

.music-icon {
    font-size: 28px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.music-control:hover .music-icon {
    transform: scale(1.1);
}

.music-control.paused .music-icon {
    opacity: 0.6;
}

/* 音乐波浪动画 */
.music-wave {
    position: absolute;
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.music-control.playing .music-wave {
    opacity: 1;
}

.music-wave span {
    width: 3px;
    background: white;
    border-radius: 2px;
    animation: wave 1s ease-in-out infinite;
}

.music-wave span:nth-child(1) {
    height: 8px;
    animation-delay: 0s;
}

.music-wave span:nth-child(2) {
    height: 14px;
    animation-delay: 0.2s;
}

.music-wave span:nth-child(3) {
    height: 10px;
    animation-delay: 0.4s;
}

@keyframes wave {
    0%, 100% {
        transform: scaleY(0.5);
    }
    50% {
        transform: scaleY(1);
    }
}

@keyframes musicPulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 6px 30px rgba(102, 126, 234, 0.8), 0 0 40px rgba(102, 126, 234, 0.4);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100px);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 移动端音乐控制按钮调整 */
@media (max-width: 768px) {
    .music-control {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .music-icon {
        font-size: 24px;
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    color: #333;
}

.close {
    color: #adb5bd;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close:hover {
    color: #495057;
}

.modal-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
}

.required {
    color: #ff6b6b;
}

.form-group input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.error-message {
    background: #fff5f5;
    color: #c92a2a;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    border-left: 3px solid #c92a2a;
}

/* 成功提示（与待办/客户页面保持一致，右下角） */
.success-toast {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 30px;
    min-width: 200px;
    max-width: 350px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 3001;
    animation: slideInRight 0.4s ease;
    overflow: hidden;
}

/* 新增动画效果 */
@keyframes slideInDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

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

.success-toast-content {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.success-icon {
    font-size: 24px;
    font-weight: bold;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.success-toast.success .success-icon {
    background: #28a745;
    color: white;
}

.success-toast.info .success-icon {
    background: #17a2b8;
    color: white;
}

.success-toast.warning .success-icon {
    background: #ffc107;
    color: #333;
}

.success-toast.error .success-icon {
    background: #dc3545;
    color: white;
}

.success-message {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.success-toast.hiding {
    animation: slideOutRight 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding-left: 0;
    }

    .container {
        padding: 15px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    /* 新版header响应式 */
    .container > header {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    #welcomeBanner {
        width: 100%;
        max-width: none;
    }
    
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .header-actions .btn,
    .header-actions a.btn {
        font-size: 13px;
        padding: 8px 12px;
    }

    .header-right {
        width: 100%;
        justify-content: flex-start;
    }

    .user-info {
        flex-wrap: wrap;
    }

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

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

    .activity-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 20px;
    }

    .header-left h1 {
        font-size: 24px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-icon {
        font-size: 36px;
    }

    .stat-number {
        font-size: 28px;
    }

    .btn {
        padding: 8px 15px;
        font-size: 13px;
    }
}

/* 修改密码模态框样式 */
.password-modal {
    max-width: 500px;
    margin-top: 120px;
}

.password-modal .form-group {
    margin-bottom: 25px;
}

.password-modal .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
    font-size: 0.95em;
}

.password-modal .label-icon {
    font-size: 1.1em;
}

.password-modal .form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.3s;
    background: #f9f9f9;
}

.password-modal .form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.password-modal .form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #999;
}

.password-modal .error-message {
    background: #fee;
    color: #c33;
    padding: 12px 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #e74c3c;
    font-size: 0.9em;
}

.password-modal .modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.password-modal .modal-footer button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 1em;
}

.password-modal .modal-footer .btn-secondary {
    background: #95a5a6;
}

.password-modal .modal-footer .btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

.password-modal .modal-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.password-modal .modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.password-modal .modal-footer .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

