/* 通阜环保平台 UI 增强样式 */
/* 版本: 1.0.0 | 日期: 2026-07-06 */

/* ============ 全局变量 ============ */
:root {
    /* 品牌色彩 */
    --tf-primary: #1677ff;
    --tf-primary-dark: #0958d9;
    --tf-primary-light: #e6f4ff;
    --tf-success: #52c41a;
    --tf-warning: #faad14;
    --tf-error: #ff4d4f;
    
    /* 灰度 */
    --tf-gray-1: #ffffff;
    --tf-gray-2: #fafafa;
    --tf-gray-3: #f5f5f5;
    --tf-gray-4: #f0f0f0;
    --tf-gray-5: #d9d9d9;
    --tf-gray-6: #bfbfbf;
    --tf-gray-7: #8c8c8c;
    --tf-gray-8: #595959;
    --tf-gray-9: #434343;
    --tf-gray-10: #262626;
    --tf-gray-11: #1f1f1f;
    --tf-gray-12: #141414;
    --tf-gray-13: #000000;
    
    /* 阴影 */
    --tf-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
    --tf-shadow-md: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
    --tf-shadow-lg: 0 12px 40px 0 rgba(0, 0, 0, 0.12), 0 8px 16px -8px rgba(0, 0, 0, 0.08);
    
    /* 圆角 */
    --tf-radius-sm: 6px;
    --tf-radius-md: 8px;
    --tf-radius-lg: 12px;
    --tf-radius-xl: 16px;
    
    /* 间距 */
    --tf-space-xs: 4px;
    --tf-space-sm: 8px;
    --tf-space-md: 16px;
    --tf-space-lg: 24px;
    --tf-space-xl: 32px;
}

/* ============ 全局样式优化 ============ */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============ 登录页优化 ============ */
.login-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--tf-radius-xl);
    box-shadow: var(--tf-shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.6s ease-out;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--tf-primary) 0%, #722ed1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 12px 0 8px;
}

.login-logo p {
    color: var(--tf-gray-7);
    font-size: 14px;
}

/* ============ 输入框增强 ============ */
.van-field__control {
    border-radius: var(--tf-radius-md) !important;
    transition: all 0.3s ease;
}

.van-field__control:focus {
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.15);
}

/* ============ 按钮增强 ============ */
.van-button--primary {
    background: linear-gradient(135deg, var(--tf-primary) 0%, #4096ff 100%) !important;
    border: none !important;
    border-radius: var(--tf-radius-md) !important;
    font-weight: 600 !important;
    letter-spacing: 1px;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(22, 119, 255, 0.35) !important;
}

.van-button--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 119, 255, 0.45) !important;
}

.van-button--primary:active {
    transform: translateY(0);
}

/* ============ 首页仪表盘优化 ============ */
.dashboard-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 24px;
    border-radius: var(--tf-radius-lg);
    margin-bottom: 20px;
}

.greeting-card {
    background: linear-gradient(135deg, var(--tf-primary) 0%, #722ed1 100%);
    color: white;
    padding: 24px;
    border-radius: var(--tf-radius-lg);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.greeting-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.greeting-card h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.greeting-card p {
    opacity: 0.9;
    font-size: 14px;
}

/* ============ 统计卡片增强 ============ */
.stat-card {
    background: white;
    border-radius: var(--tf-radius-lg);
    padding: 20px;
    box-shadow: var(--tf-shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--tf-gray-4);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tf-shadow-md);
    border-color: var(--tf-primary);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--tf-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}

.stat-card .stat-icon.blue {
    background: var(--tf-primary-light);
    color: var(--tf-primary);
}

.stat-card .stat-icon.green {
    background: #f6ffed;
    color: var(--tf-success);
}

.stat-card .stat-icon.orange {
    background: #fff7e6;
    color: var(--tf-warning);
}

.stat-card .stat-icon.purple {
    background: #f9f0ff;
    color: #722ed1;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--tf-gray-10);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--tf-gray-7);
}

.stat-card .stat-trend {
    font-size: 12px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-card .stat-trend.up {
    color: var(--tf-success);
}

.stat-card .stat-trend.down {
    color: var(--tf-error);
}

/* ============ 项目卡片增强 ============ */
.project-card {
    background: white;
    border-radius: var(--tf-radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--tf-shadow-sm);
    border: 1px solid var(--tf-gray-4);
    transition: all 0.3s ease;
}

.project-card:hover {
    box-shadow: var(--tf-shadow-md);
    border-color: var(--tf-primary-light);
}

.project-card .project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.project-card .project-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--tf-gray-10);
    flex: 1;
}

.project-card .project-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: var(--tf-radius-sm);
    font-weight: 500;
}

.project-card .project-status.active {
    background: #e6f4ff;
    color: var(--tf-primary);
}

.project-card .project-status.completed {
    background: #f6ffed;
    color: var(--tf-success);
}

.project-card .project-status.pending {
    background: #fff7e6;
    color: var(--tf-warning);
}

.project-card .project-progress {
    margin-top: 12px;
}

.project-card .progress-bar {
    height: 8px;
    background: var(--tf-gray-3);
    border-radius: 4px;
    overflow: hidden;
}

.project-card .progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
    background: linear-gradient(90deg, var(--tf-primary) 0%, #4096ff 100%);
}

.project-card .progress-text {
    font-size: 12px;
    color: var(--tf-gray-7);
    margin-top: 4px;
    text-align: right;
}

/* ============ 客户卡片增强 ============ */
.customer-card {
    background: white;
    border-radius: var(--tf-radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--tf-shadow-sm);
    border: 1px solid var(--tf-gray-4);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.customer-card:hover {
    box-shadow: var(--tf-shadow-md);
    border-color: var(--tf-primary-light);
}

.customer-card .customer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tf-primary) 0%, #722ed1 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.customer-card .customer-info {
    flex: 1;
    min-width: 0;
}

.customer-card .customer-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--tf-gray-10);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-card .customer-contact {
    font-size: 13px;
    color: var(--tf-gray-7);
    margin-top: 2px;
}

.customer-card .customer-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.customer-card .customer-badge.vip {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    color: #8b6914;
}

.customer-card .customer-badge.a {
    background: #e6f4ff;
    color: var(--tf-primary);
}

.customer-card .customer-badge.b {
    background: #f6ffed;
    color: var(--tf-success);
}

.customer-card .customer-badge.c {
    background: #fff7e6;
    color: var(--tf-warning);
}

.customer-card .customer-badge.potential {
    background: var(--tf-gray-3);
    color: var(--tf-gray-7);
}

/* ============ 数据图表区域 ============ */
.chart-container {
    background: white;
    border-radius: var(--tf-radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--tf-shadow-sm);
    border: 1px solid var(--tf-gray-4);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--tf-gray-10);
}

.chart-legend {
    display: flex;
    gap: 16px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--tf-gray-7);
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ============ 快捷操作增强 ============ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.quick-action-item {
    background: white;
    border-radius: var(--tf-radius-lg);
    padding: 16px 12px;
    text-align: center;
    box-shadow: var(--tf-shadow-sm);
    border: 1px solid var(--tf-gray-4);
    transition: all 0.3s ease;
    cursor: pointer;
}

.quick-action-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--tf-shadow-md);
    border-color: var(--tf-primary);
}

.quick-action-item .action-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--tf-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 8px;
    background: var(--tf-primary-light);
    color: var(--tf-primary);
}

.quick-action-item .action-text {
    font-size: 13px;
    color: var(--tf-gray-8);
    font-weight: 500;
}

/* ============ AI助手增强 ============ */
.ai-assistant-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: var(--tf-radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.ai-assistant-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ai-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tf-primary) 0%, #722ed1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.ai-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--tf-gray-10);
}

.ai-info p {
    font-size: 13px;
    color: var(--tf-gray-7);
}

.ai-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-quick-btn {
    background: white;
    border: 1px solid var(--tf-gray-4);
    border-radius: var(--tf-radius-md);
    padding: 8px 16px;
    font-size: 13px;
    color: var(--tf-gray-8);
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-quick-btn:hover {
    background: var(--tf-primary-light);
    border-color: var(--tf-primary);
    color: var(--tf-primary);
}

/* ============ 动态列表增强 ============ */
.activity-list {
    background: white;
    border-radius: var(--tf-radius-lg);
    padding: 16px;
    box-shadow: var(--tf-shadow-sm);
    border: 1px solid var(--tf-gray-4);
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--tf-gray-3);
}

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

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.activity-icon.blue {
    background: var(--tf-primary-light);
    color: var(--tf-primary);
}

.activity-icon.green {
    background: #f6ffed;
    color: var(--tf-success);
}

.activity-icon.orange {
    background: #fff7e6;
    color: var(--tf-warning);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 14px;
    color: var(--tf-gray-9);
    line-height: 1.5;
}

.activity-time {
    font-size: 12px;
    color: var(--tf-gray-6);
    margin-top: 2px;
}

/* ============ 底部导航增强 ============ */
.van-tabbar {
    background: white !important;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06) !important;
    border-top: 1px solid var(--tf-gray-3) !important;
}

.van-tabbar-item--active {
    color: var(--tf-primary) !important;
}

.van-tabbar-item__icon {
    font-size: 22px !important;
}

/* ============ 搜索框增强 ============ */
.van-search {
    background: transparent !important;
    padding: 0 !important;
}

.van-search__content {
    background: white !important;
    border-radius: var(--tf-radius-md) !important;
    border: 1px solid var(--tf-gray-4) !important;
}

.van-search__content:focus-within {
    border-color: var(--tf-primary) !important;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1) !important;
}

/* ============ 标签页增强 ============ */
.van-tabs__nav {
    background: var(--tf-gray-2) !important;
    border-radius: var(--tf-radius-md) !important;
    padding: 4px !important;
}

.van-tab {
    border-radius: var(--tf-radius-sm) !important;
    transition: all 0.3s ease !important;
}

.van-tab--active {
    background: white !important;
    box-shadow: var(--tf-shadow-sm) !important;
}

/* ============ 空状态优化 ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state img {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 16px;
    color: var(--tf-gray-8);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--tf-gray-6);
    margin-bottom: 20px;
}

/* ============ 加载动画 ============ */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-skeleton {
    background: linear-gradient(90deg, var(--tf-gray-3) 25%, var(--tf-gray-2) 50%, var(--tf-gray-3) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--tf-radius-md);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============ 响应式优化 ============ */
@media (min-width: 768px) {
    .dashboard-content {
        max-width: 1200px;
        margin: 0 auto;
        padding: 24px;
    }
    
    .stat-cards-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
    
    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 767px) {
    .stat-cards-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
}

/* ============ 滚动条美化 ============ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--tf-gray-2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--tf-gray-5);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--tf-gray-6);
}

/* ============ 选中效果 ============ */
::selection {
    background: var(--tf-primary-light);
    color: var(--tf-primary-dark);
}

/* ============ 打印优化 ============ */
@media print {
    .van-tabbar,
    .van-nav-bar {
        display: none !important;
    }
}
