:root {
    --color-primary: #409EFF;
    --color-success: #67C23A;
    --color-warning: #E6A23C;
    --color-error: #F56C6C;
    --color-info: #909399;
    --color-text-primary: #303133;
    --color-text-regular: #606266;
    --color-text-secondary: #909399;
    --color-border: #DCDFE6;
    --color-background: #F5F7FA;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.5;
    height: 100%;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 0;
    position: relative;
    background: var(--color-background);
    height: 100vh;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.dashboard-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 44px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 100;
    margin: 0 auto;
}

.nav-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #888;
    cursor: pointer;
}

.nav-icon i {
    font-size: 22px;
}

.dashboard-title {
    font-size: 18px;
    color: var(--color-text-primary);
}

/* 搜索栏（导航栏下方） */
.search-bar {
    position: fixed;
    top: 44px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    z-index: 101;
    display: flex;
    align-items: center;
    padding: 10px 12px 8px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    gap: 8px;
}
.search-input {
    flex: 1;
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 15px;
    padding: 0 12px;
    outline: none;
}
.search-close {
    font-size: 22px;
    color: #bbb;
    margin-left: 8px;
    cursor: pointer;
}

/* 筛选栏下移 */
.status-filter {
    position: sticky;
    top: 44px;
    left: 0;
    width: 100%;
    max-width: 480px;
    background: #fff;
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    z-index: 99;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 搜索中时调整筛选栏和列表位置 */
.main-content.searching .status-filter {
    top: 92px;
}

.filter-select {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 14px;
    color: var(--color-text-primary);
    background: #fff;
}

.device-list {
    margin-top: 56px;
    padding: 0px 10px;
    background: transparent;
}

/* 搜索中时调整筛选栏和列表位置 */
.main-content.searching .device-list {
    margin-top: 48px;
}

.device-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: all 0.2s;
}
.device-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.card-main {
    display: flex;
    align-items: center;
    gap: 12px;
}
.card-info {
    flex: 1;
    min-width: 0;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}
.card-type {
    font-size: 13px;
    color: var(--color-text-secondary);
}
.card-status {
    display: flex;
    gap: 8px;
}
.device-status.tag {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: white;
    white-space: nowrap;
}
.device-status.operating {
    background-color: var(--color-success);
}
.device-status.idle {
    background-color: var(--color-warning);
}
.device-status.stopped {
    background-color: var(--color-error);
}
.device-status.normal {
    background-color: var(--color-success);
}
.card-project {
    font-size: 13px;
    color: var(--color-text-regular);
    margin-bottom: 4px;
}
.empty-tip {
    text-align: center;
    color: #bbb;
    padding: 32px 0;
    font-size: 15px;
}
@media (max-width: 320px) {
    .dashboard-header {
        padding: 0 2px;
    }
    .search-bar, .status-filter {
        padding: 8px 4px;
    }
    .search-input {
        font-size: 13px;
        padding: 0 6px;
    }
    .filter-select {
        font-size: 13px;
        padding: 4px 6px;
    }
}

/* 消息抽屉 */
.message-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 360px;
    height: 100%;
    background: #fff;
    z-index: 1000;
    transition: left 0.3s ease;
}

.message-drawer.open {
    left: 0;
}

.drawer-header {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 16px;
    font-weight: 500;
}

.drawer-close {
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.drawer-content {
    padding: 16px;
}

.message-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.drawer-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    display: none;
}

.drawer-mask.open {
    display: block;
}

.msg-content {
    font-size: 14px;
    margin-bottom: 4px;
}

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

/* 我的抽屉 */
.my-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 360px;
    height: 100%;
    background: #fff;
    z-index: 1000;
    transition: right 0.3s ease;
}

.my-drawer.open {
    right: 0;
}

#myDrawerMask.drawer-mask {
    display: none;
}

#myDrawerMask.open {
    display: block;
}

.my-content {
    display: flex;
    flex-direction: column;
    height: calc(100% - 44px);
}

.my-profile {
    display: flex;
    align-items: center;
    padding: 24px 16px;
    border-bottom: 1px solid var(--color-border);
}

.my-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.my-avatar i {
    font-size: 30px;
    color: #bfbfbf;
}

.my-info {
    flex: 1;
}

.my-name {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 4px;
}

.my-role {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.my-menu {
    flex: 1;
    padding: 12px 0;
}

.my-menu-item {
    padding: 16px;
    display: flex;
    align-items: center;
    color: var(--color-text-primary);
    cursor: pointer;
}

.my-menu-item i {
    font-size: 18px;
    margin-right: 12px;
    color: var(--color-primary);
}

.my-menu-item:hover {
    background: #f5f7fa;
}

.my-logout {
    margin: 16px;
    padding: 12px;
    border: none;
    background: var(--color-error);
    color: white;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.my-logout:hover {
    background: #f78989;
} 