/* 通阜环保移动办公平台 - 主样式 */

/* 全局变量 */
:root {
    --primary-color: #1890ff;
    --primary-dark: #096dd9;
    --secondary-color: #52c41a;
    --warning-color: #faad14;
    --danger-color: #ff4d4f;
    --success-color: #52c41a;
    --info-color: #1890ff;
    --text-color: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --border-color: #e8e8e8;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --radius: 8px;
    --header-height: 56px;
    --bottom-nav-height: 60px;
}

/* 重置样式 */
* {
    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-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 启动画面 */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s;
}

.splash-content {
    text-align: center;
    color: white;
}

.splash-content .logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.splash-content h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.splash-content p {
    font-size: 16px;
    opacity: 0.8;
    margin-bottom: 30px;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: white;
    border-radius: 2px;
    animation: loading 1.5s ease-in-out;
    animation-fill-mode: forwards;
}

@keyframes loading {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* 主应用 */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-center h1 {
    font-size: 18px;
    font-weight: 500;
}

.menu-btn, .notification-btn, .user-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
}

.menu-btn:hover, .notification-btn:hover, .user-btn:hover {
    background: rgba(255,255,255,0.1);
}

.notification-btn {
    position: relative;
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* 侧边菜单 */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 200;
    transition: left 0.3s;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
}

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

.user-info i {
    font-size: 48px;
}

.user-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.user-info p {
    font-size: 14px;
    opacity: 0.8;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.3s;
    color: var(--text-color);
}

.sidebar-menu li:hover {
    background: var(--bg-color);
}

.sidebar-menu li.active {
    background: #e6f7ff;
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

.sidebar-menu li i {
    width: 24px;
    margin-right: 12px;
    font-size: 18px;
}

.sidebar-menu li span {
    font-size: 15px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-top: var(--header-height);
    margin-bottom: var(--bottom-nav-height);
    padding: 16px;
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 12px;
    cursor: pointer;
    padding: 8px 12px;
    transition: color 0.3s;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-item.active {
    color: var(--primary-color);
}

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

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border: none;
    border-radius: var(--radius);
    padding: 16px 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

.quick-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.quick-btn i {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.quick-btn span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 数据概览 */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.customers {
    background: #e6f7ff;
    color: #1890ff;
}

.stat-icon.opportunities {
    background: #fff7e6;
    color: #faad14;
}

.stat-icon.bidding {
    background: #f6ffed;
    color: #52c41a;
}

.stat-icon.inventory {
    background: #fff1f0;
    color: #ff4d4f;
}

.stat-info h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
}

.stat-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 区块标题 */
.section {
    margin-bottom: 20px;
}

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

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.see-all {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    cursor: pointer;
}

/* 页面头部 */
.page-header {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: white;
    border-radius: var(--radius);
    padding: 10px 12px;
    box-shadow: var(--shadow);
}

.search-bar i {
    color: var(--text-light);
    margin-right: 8px;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
}

.add-btn {
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: background 0.3s;
}

.add-btn:hover {
    background: var(--primary-dark);
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.filter-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 列表样式 */
.customer-list, .opportunity-list, .bidding-list, .inventory-list, .task-list, .approval-list, .todo-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.list-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
}

.list-item-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-A {
    background: #fff1f0;
    color: #ff4d4f;
}

.badge-B {
    background: #fff7e6;
    color: #faad14;
}

.badge-C {
    background: #e6f7ff;
    color: #1890ff;
}

.badge-D {
    background: #f6ffed;
    color: #52c41a;
}

.badge-status {
    background: #f0f0f0;
    color: #666;
}

.badge-pending {
    background: #fff7e6;
    color: #faad14;
}

.badge-processing {
    background: #e6f7ff;
    color: #1890ff;
}

.badge-completed {
    background: #f6ffed;
    color: #52c41a;
}

.badge-rejected {
    background: #fff1f0;
    color: #ff4d4f;
}

.list-item-content {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.list-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-light);
}

.list-item-amount {
    font-size: 16px;
    font-weight: 600;
    color: var(--warning-color);
}

/* 待办事项 */
.todo-item {
    background: white;
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.todo-item:hover {
    transform: translateX(4px);
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.todo-checkbox.checked {
    background: var(--success-color);
    border-color: var(--success-color);
}

.todo-checkbox.checked::after {
    content: '✓';
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.todo-content {
    flex: 1;
}

.todo-title {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 4px;
}

.todo-title.completed {
    text-decoration: line-through;
    color: var(--text-light);
}

.todo-time {
    font-size: 12px;
    color: var(--text-light);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlide 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    max-height: calc(80vh - 60px);
    overflow-y: auto;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* 提示框 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--success-color);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius);
    z-index: 400;
    transition: transform 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 报表样式 */
.reports-dashboard {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.report-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.report-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.chart-container {
    height: 200px;
    position: relative;
}

/* 设置页面 */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-group {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.settings-group h3 {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 12px 16px;
    background: var(--bg-color);
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

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

.settings-item span {
    font-size: 14px;
    color: var(--text-color);
}

.settings-value {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* 退出按钮 */
.logout-btn {
    width: 100%;
    padding: 14px;
    background: white;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--danger-color);
    color: white;
}

/* 遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    display: none;
}

.overlay.show {
    display: block;
}

/* 响应式 */
@media (max-width: 360px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-overview {
        grid-template-columns: 1fr;
    }
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.fade-in {
    animation: fadeIn 0.3s;
}

.slide-up {
    animation: slideUp 0.3s;
}
